pygccxml-commit Mailing List for C++ Python language bindings (Page 3)
Brought to you by:
mbaas,
roman_yakovenko
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(190) |
Apr
(166) |
May
(170) |
Jun
(75) |
Jul
(105) |
Aug
(131) |
Sep
(99) |
Oct
(84) |
Nov
(67) |
Dec
(54) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(66) |
Feb
(49) |
Mar
(25) |
Apr
(62) |
May
(21) |
Jun
(34) |
Jul
(9) |
Aug
(21) |
Sep
(5) |
Oct
|
Nov
(63) |
Dec
(34) |
2008 |
Jan
(10) |
Feb
(42) |
Mar
(26) |
Apr
(25) |
May
(6) |
Jun
(40) |
Jul
(18) |
Aug
(29) |
Sep
(6) |
Oct
(32) |
Nov
(14) |
Dec
(56) |
2009 |
Jan
(127) |
Feb
(52) |
Mar
(2) |
Apr
(10) |
May
(29) |
Jun
(3) |
Jul
|
Aug
(16) |
Sep
(4) |
Oct
(11) |
Nov
(8) |
Dec
(14) |
2010 |
Jan
(31) |
Feb
(1) |
Mar
(7) |
Apr
(9) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(8) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <rom...@us...> - 2010-01-18 19:52:44
|
Revision: 1807 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1807&view=rev Author: roman_yakovenko Date: 2010-01-18 19:52:38 +0000 (Mon, 18 Jan 2010) Log Message: ----------- update GCCXML to 1.129 Modified Paths: -------------- gccxml_bin/v09/linux2/share/man/man1/gccxml.1 Modified: gccxml_bin/v09/linux2/share/man/man1/gccxml.1 =================================================================== --- gccxml_bin/v09/linux2/share/man/man1/gccxml.1 2010-01-18 19:41:44 UTC (rev 1806) +++ gccxml_bin/v09/linux2/share/man/man1/gccxml.1 2010-01-18 19:52:38 UTC (rev 1807) @@ -1,4 +1,4 @@ -.TH GCC-XML 1 "January 06, 2009" "GCC-XML 0.9.0" +.TH GCC-XML 1 "January 18, 2010" "GCC-XML 0.9.0" .SH NAME .TP .B gccxml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-18 19:41:51
|
Revision: 1806 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1806&view=rev Author: roman_yakovenko Date: 2010-01-18 19:41:44 +0000 (Mon, 18 Jan 2010) Log Message: ----------- update GCCXML to 1.129 Modified Paths: -------------- gccxml_bin/v09/linux2/bin/gccxml gccxml_bin/v09/linux2/bin/gccxml_cc1plus Modified: gccxml_bin/v09/linux2/bin/gccxml =================================================================== (Binary files differ) Modified: gccxml_bin/v09/linux2/bin/gccxml_cc1plus =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-16 19:14:31
|
Revision: 1805 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1805&view=rev Author: roman_yakovenko Date: 2010-01-16 19:14:12 +0000 (Sat, 16 Jan 2010) Log Message: ----------- fix bug related to merging free functions Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/__init__.py pygccxml_dev/pygccxml/declarations/calldef.py pygccxml_dev/pygccxml/declarations/decl_printer.py pygccxml_dev/unittests/xmlfile_reader_tester.py Added Paths: ----------- pygccxml_dev/unittests/data/merge_free_functions.hpp Modified: pygccxml_dev/pygccxml/declarations/__init__.py =================================================================== --- pygccxml_dev/pygccxml/declarations/__init__.py 2010-01-14 12:54:55 UTC (rev 1804) +++ pygccxml_dev/pygccxml/declarations/__init__.py 2010-01-16 19:14:12 UTC (rev 1805) @@ -262,6 +262,7 @@ from mdecl_wrapper import mdecl_wrapper_t from decl_printer import decl_printer_t +from decl_printer import dump_declarations from decl_printer import print_declarations @@ -334,10 +335,3 @@ __impl_matchers[ namespace_t.free_operator ] = operator_matcher_t __impl_decl_types[ namespace_t.free_operator ] = free_operator_t - - - - - - - Modified: pygccxml_dev/pygccxml/declarations/calldef.py =================================================================== --- pygccxml_dev/pygccxml/declarations/calldef.py 2010-01-14 12:54:55 UTC (rev 1804) +++ pygccxml_dev/pygccxml/declarations/calldef.py 2010-01-16 19:14:12 UTC (rev 1805) @@ -177,7 +177,8 @@ , self.return_type , self.has_extern , self.does_throw - , self._sorted_list( self.exceptions ) ] + , self._sorted_list( self.exceptions ) + , self.demangled_name ] items.extend( self._get__cmp__call_items() ) return items @@ -188,8 +189,8 @@ and self.arguments == other.arguments \ and self.has_extern == other.has_extern \ and self.does_throw == other.does_throw \ - and self._sorted_list( self.exceptions ) \ - == other._sorted_list( other.exceptions ) + and self._sorted_list( self.exceptions ) == other._sorted_list( other.exceptions ) \ + and self.demangled_name == other.demangled_name def _get_arguments(self): return self._arguments Modified: pygccxml_dev/pygccxml/declarations/decl_printer.py =================================================================== --- pygccxml_dev/pygccxml/declarations/decl_printer.py 2010-01-14 12:54:55 UTC (rev 1804) +++ pygccxml_dev/pygccxml/declarations/decl_printer.py 2010-01-16 19:14:12 UTC (rev 1805) @@ -285,3 +285,14 @@ prn.level = 0 prn.instance = d algorithm.apply_visitor(prn, d) + +def dump_declarations( decls, fpath ): + """ + dump declarations tree rooted at each of the included nodes to the file + + :param decls: either a single :class:declaration_t object or list of :class:declaration_t objects + :param fpath: file name + """ + fobj = file( fpath, 'w+' ) + print_declarations( decls, writer=fobj.write ) + fobj.close() Added: pygccxml_dev/unittests/data/merge_free_functions.hpp =================================================================== --- pygccxml_dev/unittests/data/merge_free_functions.hpp (rev 0) +++ pygccxml_dev/unittests/data/merge_free_functions.hpp 2010-01-16 19:14:12 UTC (rev 1805) @@ -0,0 +1,32 @@ +// Copyright 2004-2008 Roman Yakovenko. +// 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) + +#ifndef __merge_free_functions_hpp__ +#define __merge_free_functions_hpp__ + +#include <iostream> + +/* +namespace n1{ + +struct s1{}; +struct s2{}; + +template<typename _Facet> +bool has_facet(int i) throw(){ + return false; +} + +void do_smth(){ + has_facet<s1>( 12 ); + has_facet<s2>( 12 ); +} + +} +*/ + + +#endif//__merge_free_functions_hpp__ + Modified: pygccxml_dev/unittests/xmlfile_reader_tester.py =================================================================== --- pygccxml_dev/unittests/xmlfile_reader_tester.py 2010-01-14 12:54:55 UTC (rev 1804) +++ pygccxml_dev/unittests/xmlfile_reader_tester.py 2010-01-16 19:14:12 UTC (rev 1805) @@ -3,6 +3,7 @@ # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +import os import unittest import autoconfig import parser_test_case @@ -14,13 +15,15 @@ class tester_t( parser_test_case.parser_test_case_t ): def __init__(self, *args): parser_test_case.parser_test_case_t.__init__(self, *args) - self.__fname = 'core_types.hpp' + #self.__fname = 'core_types.hpp' + self.__fname = 'merge_free_functions.hpp' def test(self): src_reader = parser.source_reader_t( self.config ) src_decls = src_reader.read_file( self.__fname ) xmlfile = src_reader.create_xml_file( self.__fname ) + print xmlfile try: fconfig = parser.file_configuration_t( data=xmlfile , start_with_declarations=None @@ -29,11 +32,16 @@ prj_reader = parser.project_reader_t( self.config ) prj_decls = prj_reader.read_files( [fconfig] , compilation_mode=parser.COMPILATION_MODE.FILE_BY_FILE ) - - self.failUnless( src_decls == prj_decls - , "There is a difference between declarations in file %s." % self.__fname ) + + declarations.dump_declarations( src_decls + , os.path.join( autoconfig.build_directory, 'xmlfile_reader.src.txt' ) ) + declarations.dump_declarations( prj_decls + , os.path.join( autoconfig.build_directory, 'xmlfile_reader.prj.txt' ) ) + + if src_decls != prj_decls: + self.fail( "There is a difference between declarations in file %s." % self.__fname ) finally: - utils.remove_file_no_raise( xmlfile ) + pass #utils.remove_file_no_raise( xmlfile ) def create_suite(): suite = unittest.TestSuite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-14 12:55:02
|
Revision: 1804 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1804&view=rev Author: roman_yakovenko Date: 2010-01-14 12:54:55 +0000 (Thu, 14 Jan 2010) Log Message: ----------- implement PY_SIGNATURE functionality Modified Paths: -------------- pyplusplus_dev/environment.py pyplusplus_dev/pyplusplus/code_repository/call_policies.py pyplusplus_dev/pyplusplus/code_repository/return_range.py Modified: pyplusplus_dev/environment.py =================================================================== --- pyplusplus_dev/environment.py 2010-01-14 10:17:58 UTC (rev 1803) +++ pyplusplus_dev/environment.py 2010-01-14 12:54:55 UTC (rev 1804) @@ -32,7 +32,7 @@ if 'roman' in getpass.getuser(): if sys.platform == 'win32': scons.suffix = '.pyd' - scons.ccflags = ['/MD', '/EHsc', '/GR', '/Zc:wchar_t', '/Zc:forScope', '-DBOOST_PYTHON_NO_PY_SIGNATURES' ] + scons.ccflags = ['/MD', '/EHsc', '/GR', '/Zc:wchar_t', '/Zc:forScope' ] boost.libs = [ r'e:\dev\boost_svn\bin.v2\libs\python\build\msvc-9.0\release\threading-multi' ] boost.include = 'e:/dev/boost_svn' python.libs = 'c:/program files/python26/libs' @@ -41,14 +41,14 @@ os.nice( 20 ) print 'test process niceness: 20' scons.suffix = '.so' - scons.ccflags = ['-DBOOST_PYTHON_NO_PY_SIGNATURES' ] + scons.ccflags = [] boost.libs = ['/home/roman/include/libs' ] boost.include = '/home/roman/boost_svn' python.include = '/usr/include/python2.6' elif 'root' == getpass.getuser(): if sys.platform == 'win32': scons.suffix = '.pyd' - scons.ccflags = ['/MD', '/EHsc', '/GR', '/Zc:wchar_t', '/Zc:forScope', '-DBOOST_PYTHON_NO_PY_SIGNATURES' ] + scons.ccflags = ['/MD', '/EHsc', '/GR', '/Zc:wchar_t', '/Zc:forScope' ] boost.libs = [ 'd:/dev/boost_svn/bin.v2/libs/python/build/msvc-7.1/release/threading-multi' ] boost.include = 'd:/dev/boost_svn' python.libs = 'e:/python25/libs' Modified: pyplusplus_dev/pyplusplus/code_repository/call_policies.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/call_policies.py 2010-01-14 10:17:58 UTC (rev 1803) +++ pyplusplus_dev/pyplusplus/code_repository/call_policies.py 2010-01-14 12:54:55 UTC (rev 1804) @@ -161,6 +161,11 @@ MemoryManager::deallocate_array( arr ); return bpl::incref( bpl::tuple( list_ ).ptr() ); } + + static PyTypeObject const *get_pytype(){ + return &PyTuple_Type; + } + }; } Modified: pyplusplus_dev/pyplusplus/code_repository/return_range.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/return_range.py 2010-01-14 10:17:58 UTC (rev 1803) +++ pyplusplus_dev/pyplusplus/code_repository/return_range.py 2010-01-14 12:54:55 UTC (rev 1804) @@ -34,8 +34,8 @@ namespace detail{ -struct return_raw_data_ref{ - +struct return_raw_data_ref +{ template <class T> struct apply{ @@ -57,10 +57,12 @@ return PyCObject_FromVoidPtr( data, NULL ); } } + + static PyTypeObject const * get_pytype(){ + return &PyCObject_Type; + } }; - }; - }; } //detail This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-14 10:18:06
|
Revision: 1803 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1803&view=rev Author: roman_yakovenko Date: 2010-01-14 10:17:58 +0000 (Thu, 14 Jan 2010) Log Message: ----------- fix code generation for static array properties Modified Paths: -------------- pyplusplus_dev/pyplusplus/code_creators/member_variable.py pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp pyplusplus_dev/unittests/member_variables_tester.py Modified: pyplusplus_dev/pyplusplus/code_creators/member_variable.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/member_variable.py 2010-01-14 08:50:23 UTC (rev 1802) +++ pyplusplus_dev/pyplusplus/code_creators/member_variable.py 2010-01-14 10:17:58 UTC (rev 1803) @@ -434,7 +434,6 @@ class array_mv_wrapper_t( code_creator.code_creator_t , declaration_based.declaration_based_t ): """registers array class""" - def __init__(self, variable ): code_creator.code_creator_t.__init__( self ) declaration_based.declaration_based_t.__init__( self, declaration=variable) @@ -463,9 +462,12 @@ @property def wrapper_creator_type(self): - return declarations.free_function_type_t( - return_type=self.wrapper_type - , arguments_types=[self.wrapped_class_type] ) + if self.declaration.type_qualifiers.has_static: + return declarations.free_function_type_t( return_type=self.wrapper_type ) + else: + return declarations.free_function_type_t( + return_type=self.wrapper_type + , arguments_types=[self.wrapped_class_type] ) @property def wrapper_creator_name(self): @@ -475,15 +477,21 @@ def wrapper_creator_full_name(self): return '::'.join( [self.parent.full_name, self.wrapper_creator_name] ) - def _create_impl( self ): - tmpl = os.linesep.join([ - "static %(wrapper_type)s" - , "%(wrapper_creator_name)s( %(wrapped_class_type)s inst ){" - , self.indent( "return %(wrapper_type)s( inst.%(mem_var_ref)s );" ) - , "}" - ]) + def _create_impl( self ): + tmpl = [ "static %(wrapper_type)s" ] + if self.declaration.type_qualifiers.has_static: + tmpl.append( "%(wrapper_creator_name)s(){" ) + tmpl.append( self.indent( "return %(wrapper_type)s( %(parent_class_type)s::%(mem_var_ref)s );" ) ) + else: + tmpl.append( "%(wrapper_creator_name)s( %(wrapped_class_type)s inst ){" ) + tmpl.append( self.indent( "return %(wrapper_type)s( inst.%(mem_var_ref)s );" ) ) + tmpl.append( "}" ) + + tmpl = os.linesep.join( tmpl ) + return tmpl % { 'wrapper_type' : self.wrapper_type.decl_string + , 'parent_class_type' : self.parent.declaration.partial_decl_string , 'wrapper_creator_name' : self.wrapper_creator_name , 'wrapped_class_type' : self.wrapped_class_type.decl_string , 'mem_var_ref' : self.declaration.name Modified: pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp =================================================================== --- pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp 2010-01-14 08:50:23 UTC (rev 1802) +++ pyplusplus_dev/unittests/data/member_variables_to_be_exported.cpp 2010-01-14 10:17:58 UTC (rev 1803) @@ -8,6 +8,7 @@ namespace member_variables{ const array_t::variable_t array_t::vars[] = { array_t::variable_t(), array_t::variable_t(), array_t::variable_t() }; +array_t::variable_t array_t::vars_nonconst[] = { array_t::variable_t(), array_t::variable_t(), array_t::variable_t() }; int point::instance_count = 0; const point::color point::default_color = point::red; Modified: pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp 2010-01-14 08:50:23 UTC (rev 1802) +++ pyplusplus_dev/unittests/data/member_variables_to_be_exported.hpp 2010-01-14 10:17:58 UTC (rev 1803) @@ -66,6 +66,7 @@ } static const variable_t vars[3]; + static variable_t vars_nonconst[3]; int ivars[10]; int ivars2[10]; }; Modified: pyplusplus_dev/unittests/member_variables_tester.py =================================================================== --- pyplusplus_dev/unittests/member_variables_tester.py 2010-01-14 08:50:23 UTC (rev 1802) +++ pyplusplus_dev/unittests/member_variables_tester.py 2010-01-14 10:17:58 UTC (rev 1803) @@ -106,10 +106,17 @@ array.ivars[index] = index * index self.failUnless( array.get_ivars_item( index ) == index * index ) - self.failUnless( len( array.vars ) == 3 ) - for i in range( len( array.vars ) ): - self.failUnless( array.vars[i].value == -9 ) + #~ import pdb + #~ pdb.set_trace() + self.failUnless( len( module.array_t.vars ) == 3 ) + for i in range( len( module.array_t.vars ) ): + self.failUnless( module.array_t.vars[i].value == -9 ) + + self.failUnless( len( module.array_t.vars_nonconst ) == 3 ) + for i in range( len( module.array_t.vars_nonconst ) ): + self.failUnless( module.array_t.vars_nonconst[i].value == -9 ) + def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-14 08:50:30
|
Revision: 1802 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1802&view=rev Author: roman_yakovenko Date: 2010-01-14 08:50:23 +0000 (Thu, 14 Jan 2010) Log Message: ----------- integrating input_static_array FT Modified Paths: -------------- pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest pyplusplus_dev/pyplusplus/function_transformers/transformer.py pyplusplus_dev/unittests/test_all.py Added Paths: ----------- pyplusplus_dev/docs/documentation/functions/transformation/inout_static_array.rest pyplusplus_dev/unittests/data/ft_inout_static_array_to_be_exported.hpp pyplusplus_dev/unittests/ft_inout_static_array_tester.py Added: pyplusplus_dev/docs/documentation/functions/transformation/inout_static_array.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/inout_static_array.rest (rev 0) +++ pyplusplus_dev/docs/documentation/functions/transformation/inout_static_array.rest 2010-01-14 08:50:23 UTC (rev 1802) @@ -0,0 +1,72 @@ +==================================== +``inout_static_array`` transformer +==================================== + +---------- +Definition +---------- + +``inout_static_array`` transformer is a combination of :doc:`input <input_static_array>` +and :doc:`output <output_static_array>` transformers. +It allows to call a C++ function, which takes an array using Python ``list`` class + +"inout_static_array" transformer takes as first argument name or index of the +original function argument. The argument should have "array" or "pointer" type. +The second argument specifies the array size. + +------- +Example +------- + +.. code-block:: c++ + + int sum_and_fill( int v[3], int value ){ + int result = v[0] + v[1] + v[2]; + v[0] = value; + v[1] = value; + v[2] = value; + return result; + } + +In order to expose ``sum_and_fill`` function we need to create a small wrapper. +The following :doc:`Py++ <../../../pyplusplus>` code does it for you: + + .. code-block:: python + + from pyplusplus import module_builder + from pyplusplus import function_transformers as FT + + mb = module_builder.module_builder_t( ... ) + sum_and_fill = mb.free_fun( 'sum_and_fill' ) + sum_and_fill.add_transformation( ft.inout_static_array('v', 3) ) + +What you see below is the relevant pieces of generated code: + + .. code-block:: c++ + + static boost::python::tuple sum_and_fill_2dd285a3344dbf7d71ffb7c78dd614c5( boost::python::object v, int value ){ + int native_v[3]; + boost::python::list py_v; + pyplus_conv::ensure_uniform_sequence< int >( v, 3 ); + pyplus_conv::copy_sequence( v, pyplus_conv::array_inserter( native_v, 3 ) ); + int result = ::sum_and_fill(native_v, value); + pyplus_conv::copy_container( native_v, native_v + 3, pyplus_conv::list_inserter( py_v ) ); + return bp::make_tuple( result, py_v ); + } + + BOOST_PYTHON_MODULE(ft_inout_static_array){ + { //::ft::sum_and_fill + + typedef boost::python::tuple ( *sum_and_fill_function_type )( boost::python::object,int ); + + bp::def( + "sum_and_fill" + , sum_and_fill_function_type( &sum_and_fill_2dd285a3344dbf7d71ffb7c78dd614c5 ) + , ( bp::arg("v"), bp::arg("value") ) ); + } + } + +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html +.. _`Python`: http://www.python.org +.. _`GCC-XML`: http://www.gccxml.org + Modified: pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2010-01-13 12:05:21 UTC (rev 1801) +++ pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2010-01-14 08:50:23 UTC (rev 1802) @@ -92,6 +92,7 @@ modify_type.rest input_static_array.rest output_static_array.rest + inout_static_array.rest transfer_ownership.rest input_c_buffer.rest from_address.rest Modified: pyplusplus_dev/pyplusplus/function_transformers/transformer.py =================================================================== --- pyplusplus_dev/pyplusplus/function_transformers/transformer.py 2010-01-13 12:05:21 UTC (rev 1801) +++ pyplusplus_dev/pyplusplus/function_transformers/transformer.py 2010-01-14 08:50:23 UTC (rev 1802) @@ -39,7 +39,7 @@ found = filter( lambda arg: arg.name == reference, self.function.arguments ) if len( found ) == 1: return found[0] - raise RuntimeError( "Argument with %s was not found" % reference ) + raise RuntimeError( "Argument with name \"%s\" was not found" % reference ) else: assert isinstance( reference, int ) if transformer_t.USE_1_BASED_INDEXING: Added: pyplusplus_dev/unittests/data/ft_inout_static_array_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/ft_inout_static_array_to_be_exported.hpp (rev 0) +++ pyplusplus_dev/unittests/data/ft_inout_static_array_to_be_exported.hpp 2010-01-14 08:50:23 UTC (rev 1802) @@ -0,0 +1,55 @@ +// Copyright 2004-2008 Roman Yakovenko. +// 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) + +#ifndef __ft_inout_static_array_to_be_exported_hpp__ +#define __ft_inout_static_array_to_be_exported_hpp__ + +#include <cmath> +#include <string> +#include <iostream> + + +int sum_and_fill( int v[3], int value ){ + int result = v[0] + v[1] + v[2]; + v[0] = value; + v[1] = value; + v[2] = value; + return result; +} + +struct point3d_t{ + + point3d_t() + : x( 0 ), y(0), z(0) + {} + + int initialize( int v[3] ){ + x = v[0]; + y = v[1]; + z = v[2]; + return x*y*z; + } + + virtual void position( int v[3] ){ + v[0] = x; + v[1] = y; + v[2] = z; + } + + void swap( int v[3] ){ + std::swap( x, v[0] ); + std::swap( y, v[1] ); + std::swap( z, v[2] ); + } + + virtual void swap_derived( int v[3] ){ + this->swap( v ); + } + + int x, y, z; +}; + + +#endif//__ft_inout_static_array_to_be_exported_hpp__ Added: pyplusplus_dev/unittests/ft_inout_static_array_tester.py =================================================================== --- pyplusplus_dev/unittests/ft_inout_static_array_tester.py (rev 0) +++ pyplusplus_dev/unittests/ft_inout_static_array_tester.py 2010-01-14 08:50:23 UTC (rev 1802) @@ -0,0 +1,70 @@ +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +import os +import sys +import math +import unittest +import fundamental_tester_base +from pygccxml import declarations +from pyplusplus import function_transformers as ft +from pyplusplus.module_builder import call_policies + + +def remove_const_ref(type): + """Converts "T const&" into "T &" """ + if declarations.type_traits.is_reference(type): + t = declarations.cpptypes.reference_t(declarations.type_traits.remove_const(type.base)) + return t + return type + + +class tester_t(fundamental_tester_base.fundamental_tester_base_t): + EXTENSION_NAME = 'ft_inout_static_array' + + def __init__( self, *args ): + fundamental_tester_base.fundamental_tester_base_t.__init__( + self + , tester_t.EXTENSION_NAME + , *args ) + + def customize( self, mb ): + mb.global_ns.calldefs().create_with_signature = True + + sum_and_fill = mb.global_ns.calldef( 'sum_and_fill' ) + sum_and_fill.add_transformation( ft.inout_static_array( 'v', 3 ) ) + + point3d = mb.class_( 'point3d_t' ) + point3d.add_wrapper_code( '' ) + + swap = point3d.calldefs( lambda d: 'swap' in d.name ) + swap.add_transformation( ft.inout_static_array( 'v', 3 ) ) + + + point3d.mem_fun( 'initialize' ).add_transformation( ft.input_static_array(0, size=3) ) + point3d.mem_fun( 'position' ).add_transformation( ft.output_static_array(0, size=3) ) + + def run_tests(self, module): + """Run the actual unit tests. + """ + point3d = module.point3d_t() + result = point3d.initialize( [ 1,2,3 ] ) + self.failUnless( result== 1*2*3 and point3d.x == 1 and point3d.y==2 and point3d.z==3 ) + self.failUnless( [1,2,3] == point3d.position() ) + + self.failUnless( ( 12, [10,10,10] ) == module.sum_and_fill( [2,4,6], 10 ) ) + self.failUnless( [1,2,3] == point3d.swap( [4,5,6] ) + and [4,5,6] == point3d.position() ) + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t)) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() Modified: pyplusplus_dev/unittests/test_all.py =================================================================== --- pyplusplus_dev/unittests/test_all.py 2010-01-13 12:05:21 UTC (rev 1801) +++ pyplusplus_dev/unittests/test_all.py 2010-01-14 08:50:23 UTC (rev 1802) @@ -125,6 +125,7 @@ import ft_input_static_matrix_tester import ft_output_static_matrix_tester import ft_inout_static_matrix_tester +import ft_inout_static_array_tester testers = [ algorithms_tester @@ -238,6 +239,7 @@ , ft_input_static_matrix_tester , ft_output_static_matrix_tester , ft_inout_static_matrix_tester + , ft_inout_static_array_tester # , ogre_generate_tester too much time ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-13 12:05:28
|
Revision: 1801 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1801&view=rev Author: roman_yakovenko Date: 2010-01-13 12:05:21 +0000 (Wed, 13 Jan 2010) Log Message: ----------- integrating inout_static_matrix implementation Modified Paths: -------------- pyplusplus_dev/docs/documentation/functions/transformation/inout.rest pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest Added Paths: ----------- pyplusplus_dev/docs/documentation/functions/transformation/inout_static_matrix.rest pyplusplus_dev/pyplusplus/code_repository/indexing_suite/registry_utils_header.py Modified: pyplusplus_dev/docs/documentation/functions/transformation/inout.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/inout.rest 2010-01-13 11:45:48 UTC (rev 1800) +++ pyplusplus_dev/docs/documentation/functions/transformation/inout.rest 2010-01-13 12:05:21 UTC (rev 1801) @@ -6,7 +6,7 @@ Definition ---------- -``inout`` transformer is a combination of :doc:`input <inout>` and :doc:`output <output>` transformers. +``inout`` transformer is a combination of :doc:`input <input>` and :doc:`output <output>` transformers. It removes a "reference" type from the function argument and then adds the "returned", by the original function, value to the return statement of the function-wrapper. Added: pyplusplus_dev/docs/documentation/functions/transformation/inout_static_matrix.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/inout_static_matrix.rest (rev 0) +++ pyplusplus_dev/docs/documentation/functions/transformation/inout_static_matrix.rest 2010-01-13 12:05:21 UTC (rev 1801) @@ -0,0 +1,91 @@ +==================================== +``inout_static_matrix`` transformer +==================================== + +---------- +Definition +---------- + +``inout_static_matrix`` transformer is a combination of :doc:`input <input_static_matrix>` +and :doc:`output <output_static_matrix>` transformers. +It allows to call a C++ function, which takes 2D array using Python ``list`` class + +"input_static_matrix" transformer takes as first argument name or index of the +original function argument. The argument should have "array" or "pointer" type. +The second and the third arguments specify rows and columns sizes. + +----------- +Limitations +----------- + +This transformer could not be applied on virtual functions. + +------- +Example +------- + +.. code-block:: c++ + + int sum_and_fill( int m[2][3], int value ){ + int result = 0; + for( int r = 0; r < 2; ++r ){ + for( int c = 0; c < 3; ++c ){ + result += m[r][c]; + m[r][c] *= value; + } + } + return result; + } + +In order to expose ``sum_and_fill`` function we need to create a small wrapper. +The following :doc:`Py++ <../../../pyplusplus>` code does it for you: + + .. code-block:: python + + from pyplusplus import module_builder + from pyplusplus import function_transformers as FT + + mb = module_builder.module_builder_t( ... ) + sum_and_fill = mb.free_fun( 'sum_and_fill' ) + sum_and_fill.add_transformation( ft.inout_static_matrix('m', rows=2, columns=3) ) + +What you see below is the relevant pieces of generated code: + + .. code-block:: c++ + + static boost::python::tuple sum_and_fill_ec4892ec81f672fe151a0a2caa3215f4( boost::python::object m, int value ){ + int native_m[2][3]; + boost::python::list py_m; + pyplus_conv::ensure_uniform_sequence< boost::python::list >( m, 2 ); + for( size_t row = 0; row < 2; ++row ){ + pyplus_conv::ensure_uniform_sequence< int >( m[row], 3 ); + pyplus_conv::copy_sequence( m[row], pyplus_conv::array_inserter( native_m[row], 3 ) ); + } + int result = ::ft::sum_and_fill(native_m, value); + for (int row2 = 0; row2 < 2; ++row2 ){ + boost::python::list pyrow; + pyplus_conv::copy_container( native_m[row2] + , native_m[row2] + 3 + , pyplus_conv::list_inserter( pyrow ) ); + py_m.append( pyrow ); + } + return bp::make_tuple( result, py_m ); + } + + BOOST_PYTHON_MODULE(ft_inout_static_matrix){ + { //::ft::sum_and_fill + + typedef boost::python::tuple ( *sum_and_fill_function_type )( boost::python::object,int ); + + bp::def( + "sum_and_fill" + , sum_and_fill_function_type( &sum_and_fill_ec4892ec81f672fe151a0a2caa3215f4 ) + , ( bp::arg("m"), bp::arg("value") ) ); + + } + } + +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html +.. _`Python`: http://www.python.org +.. _`GCC-XML`: http://www.gccxml.org + Modified: pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2010-01-13 11:45:48 UTC (rev 1800) +++ pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2010-01-13 12:05:21 UTC (rev 1801) @@ -97,6 +97,7 @@ from_address.rest input_static_matrix.rest output_static_matrix.rest + inout_static_matrix.rest Added: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/registry_utils_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/registry_utils_header.py (rev 0) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/registry_utils_header.py 2010-01-13 12:05:21 UTC (rev 1801) @@ -0,0 +1,55 @@ +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/registry_utils.hpp" + +code = """// Header file registry_utils.hpp +// +// provides few convenience functions for dealing with boost:python registry +// +// Copyright (c) 2010 Roman Yakovenko +// +// Use, modification and distribution is subject to 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) +// +// History +// ======= +// 2010/01/12 Roman File creation +// + +#ifndef REGISTRY_UTILS_12_01_2010_HPP +#define REGISTRY_UTILS_12_01_2010_HPP + +#include <boost/config.hpp> +#include "boost/python.hpp" +#include "boost/python/converter/registry.hpp" + +namespace boost{ namespace python{ namespace registry{ namespace utils{ + +template<class T> +bool is_registered(){ + namespace bpl = boost::python; + bpl::handle<> class_obj( bpl::objects::registered_class_object( bpl::type_id< T >())); + return class_obj.get() ? true : false; +} + +template< class T > +void register_alias( const char* name ){ + namespace bpl = boost::python; + bpl::handle<> class_obj( bpl::objects::registered_class_object( bpl::type_id< T >())); + boost::python::scope().attr( name ) = bpl::object( class_obj ); +} + +}}}} + +#endif // REGISTRY_UTILS_12_01_2010_HPP + + +""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-13 11:45:55
|
Revision: 1800 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1800&view=rev Author: roman_yakovenko Date: 2010-01-13 11:45:48 +0000 (Wed, 13 Jan 2010) Log Message: ----------- add conditional registration of std:pair type Modified Paths: -------------- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/__init__.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/algorithms_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_proxy_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_suite_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_traits_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/deque_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/element_proxy_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/element_proxy_traits_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/int_slice_helper_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/iterator_range_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/iterator_traits_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/list_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/map_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/methods_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/multimap_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/pair_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/proxy_iterator_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/python_iterator_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/set_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/shared_proxy_impl_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/slice_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/suite_utils_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/value_traits_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/vector_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/visitor_header.py pyplusplus_dev/pyplusplus/code_repository/indexing_suite/workaround_header.py Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/__init__.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/__init__.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,91 +1,93 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -code repository for Indexing Suite V2 - std containers wrappers -""" - -all = [] - -import algorithms_header -all.append( algorithms_header ) - -import container_proxy_header -all.append( container_proxy_header ) - -import container_suite_header -all.append( container_suite_header ) - -import container_traits_header -all.append( container_traits_header ) - -import deque_header -all.append( deque_header ) - -import element_proxy_header -all.append( element_proxy_header ) - -import element_proxy_traits_header -all.append( element_proxy_traits_header ) - -import int_slice_helper_header -all.append( int_slice_helper_header ) - -import iterator_range_header -all.append( iterator_range_header ) - -import iterator_traits_header -all.append( iterator_traits_header ) - -import list_header -all.append( list_header ) - -import map_header -all.append( map_header ) - -import methods_header -all.append( methods_header ) - -import multimap_header -all.append( multimap_header ) - -import pair_header -all.append( pair_header ) - -import proxy_iterator_header -all.append( proxy_iterator_header ) - -import python_iterator_header -all.append( python_iterator_header ) - -import set_header -all.append( set_header ) - -import shared_proxy_impl_header -all.append( shared_proxy_impl_header ) - -import slice_header -all.append( slice_header ) - -import slice_handler_header -all.append( slice_handler_header ) - -import suite_utils_header -all.append( suite_utils_header ) - -import value_traits_header -all.append( value_traits_header ) - -import vector_header -all.append( vector_header ) - -import visitor_header -all.append( visitor_header ) - -import workaround_header -all.append( workaround_header ) - -headers = map( lambda f: f.file_name, all ) - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +code repository for Indexing Suite V2 - std containers wrappers +""" + +all = [] + +import slice_header +all.append( slice_header ) + +import set_header +all.append( set_header ) + +import element_proxy_traits_header +all.append( element_proxy_traits_header ) + +import python_iterator_header +all.append( python_iterator_header ) + +import proxy_iterator_header +all.append( proxy_iterator_header ) + +import element_proxy_header +all.append( element_proxy_header ) + +import container_suite_header +all.append( container_suite_header ) + +import slice_handler_header +all.append( slice_handler_header ) + +import workaround_header +all.append( workaround_header ) + +import value_traits_header +all.append( value_traits_header ) + +import visitor_header +all.append( visitor_header ) + +import algorithms_header +all.append( algorithms_header ) + +import vector_header +all.append( vector_header ) + +import methods_header +all.append( methods_header ) + +import deque_header +all.append( deque_header ) + +import shared_proxy_impl_header +all.append( shared_proxy_impl_header ) + +import iterator_range_header +all.append( iterator_range_header ) + +import int_slice_helper_header +all.append( int_slice_helper_header ) + +import container_traits_header +all.append( container_traits_header ) + +import suite_utils_header +all.append( suite_utils_header ) + +import list_header +all.append( list_header ) + +import map_header +all.append( map_header ) + +import iterator_traits_header +all.append( iterator_traits_header ) + +import container_proxy_header +all.append( container_proxy_header ) + +import multimap_header +all.append( multimap_header ) + +import pair_header +all.append( pair_header ) + +import registry_utils_header +all.append( registry_utils_header ) + +headers = map( lambda f: f.file_name, all ) \ No newline at end of file Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/algorithms_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/algorithms_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/algorithms_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/algorithms.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/algorithms.hpp" + code = """// Header file algorithms.hpp // // Uniform interface layer for all containers. @@ -573,6 +573,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_ALGORITHMS_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_proxy_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_proxy_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_proxy_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/container_proxy.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/container_proxy.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -747,6 +747,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_CONTAINER_PROXY_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_suite_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_suite_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_suite_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/container_suite.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/container_suite.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -63,6 +63,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_CONTAINER_SUITE_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_traits_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_traits_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/container_traits_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/container_traits.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/container_traits.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -169,6 +169,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_CONTAINER_SUITE_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/deque_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/deque_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/deque_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/deque.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/deque.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -70,6 +70,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_DEQUE_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/element_proxy_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/element_proxy_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/element_proxy_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/element_proxy.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/element_proxy.hpp" + code = """// Header file element_proxy.hpp // // Proxy objects for invidivual elements in a container wrapped by @@ -197,6 +197,6 @@ } #endif // BOOST_PYTHON_INDEXING_ELEMENT_PROXY_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/element_proxy_traits_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/element_proxy_traits_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/element_proxy_traits_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/element_proxy_traits.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/element_proxy_traits.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -99,6 +99,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_ELEMENT_PROXY_TRAITS_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/int_slice_helper_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/int_slice_helper_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/int_slice_helper_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/int_slice_helper.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/int_slice_helper.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -261,6 +261,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_INT_SLICE_HELPER_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/iterator_range_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/iterator_range_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/iterator_range_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/iterator_range.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/iterator_range.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -270,6 +270,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_ITERATOR_RANGE_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/iterator_traits_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/iterator_traits_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/iterator_traits_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/iterator_traits.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/iterator_traits.hpp" + code = """// -*- mode:c++ -*- // // Header file iterator_traits.hpp @@ -221,6 +221,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_ITERATOR_TRAITS_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/list_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/list_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/list_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/list.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/list.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -177,6 +177,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_LIST_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/map_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/map_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/map_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/map.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/map.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -248,6 +248,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_MAP_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/methods_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/methods_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/methods_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/methods.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/methods.hpp" + code = """// Copyright (c) 2004 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -123,6 +123,6 @@ } } } // boost::python::indexing #endif // BOOST_PYTHON_INDEXING_METHODS_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/multimap_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/multimap_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/multimap_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/multimap.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/multimap.hpp" + code = """// Use, modification and distribution is subject to 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) @@ -213,6 +213,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_MULTIMAP_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/pair_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/pair_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/pair_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/pair.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/pair.hpp" + code = """// Header file pair.hpp // // Exposes std::pair< key, value > class @@ -31,6 +31,7 @@ #include <boost/config.hpp> #include <indexing_suite/container_traits.hpp> #include <indexing_suite/container_suite.hpp> +#include <indexing_suite/registry_utils.hpp> #include <indexing_suite/algorithms.hpp> #include <boost/detail/workaround.hpp> @@ -47,11 +48,16 @@ typedef pair_exposer_t< TValueType, TValueCallPolicies > exposer_type; pair_exposer_t(const std::string& name){ - class_< pair_type >( name.c_str() ) - .def( "__len__", &exposer_type::len ) - .def( "__getitem__", &exposer_type::get_item ) - .add_property( "key", &exposer_type::get_key ) - .add_property( "value", &exposer_type::get_mapped ); + if( boost::python::registry::utils::is_registered< pair_type >() ){ + boost::python::registry::utils::register_alias<pair_type>( name.c_str() ); + } + else{ + class_< pair_type >( name.c_str() ) + .def( "__len__", &exposer_type::len ) + .def( "__getitem__", &exposer_type::get_item ) + .add_property( "key", &exposer_type::get_key ) + .add_property( "value", &exposer_type::get_mapped ); + } } private: @@ -108,6 +114,6 @@ } } } } #endif // BOOST_PYTHON_STD_PAIR_KEY_VALUE_11_02_2007_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/proxy_iterator_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/proxy_iterator_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/proxy_iterator_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/proxy_iterator.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/proxy_iterator.hpp" + code = """ // Header file proxy_iterator.hpp // @@ -173,6 +173,6 @@ #endif #endif // BOOST_PYTHON_INDEXING_PROXY_ITERATOR_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/python_iterator_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/python_iterator_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/python_iterator_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/python_iterator.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/python_iterator.hpp" + code = """// -*- mode:c++ -*- // // Header file python_iterator.hpp @@ -90,6 +90,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_PYTHON_ITERATOR_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/set_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/set_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/set_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/set.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/set.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -177,6 +177,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_SET_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/shared_proxy_impl_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/shared_proxy_impl_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/shared_proxy_impl_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/shared_proxy_impl.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/shared_proxy_impl.hpp" + code = """// // Header file shared_proxy_impl.hpp // @@ -115,6 +115,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_SHARED_PROXY_IMPL_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/slice_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/slice_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/slice_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/slice.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/slice.hpp" + code = """// Header file slice.hpp // // Copyright (c) 2003 Raoul M. Gough @@ -152,6 +152,6 @@ }}} #endif // BOOST_PYTHON_INDEXING_SLICE_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/suite_utils_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/suite_utils_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/suite_utils_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/suite_utils.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/suite_utils.hpp" + code = """// Header file suite_utils.hpp // // Shared utilities for the indexing suite. @@ -120,6 +120,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_SUITE_UTILS_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/value_traits_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/value_traits_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/value_traits_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/value_traits.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/value_traits.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -94,6 +94,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_VALUE_TRAITS_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/vector_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/vector_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/vector_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/vector.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/vector.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -70,6 +70,6 @@ } } } #endif // BOOST_PYTHON_INDEXING_VECTOR_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/visitor_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/visitor_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/visitor_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/visitor.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/visitor.hpp" + code = """// Copyright (c) 2003 Raoul M. Gough // // Use, modification and distribution is subject to the Boost Software @@ -281,6 +281,6 @@ #undef OPTIONAL_ALGO_SUPPORT #endif // BOOST_PYTHON_INDEXING_VISITOR_HPP - - -""" + + +""" Modified: pyplusplus_dev/pyplusplus/code_repository/indexing_suite/workaround_header.py =================================================================== --- pyplusplus_dev/pyplusplus/code_repository/indexing_suite/workaround_header.py 2010-01-13 11:43:23 UTC (rev 1799) +++ pyplusplus_dev/pyplusplus/code_repository/indexing_suite/workaround_header.py 2010-01-13 11:45:48 UTC (rev 1800) @@ -1,14 +1,14 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -""" -This file contains indexing suite v2 code -""" - -file_name = "indexing_suite/workaround.hpp" - +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +""" +This file contains indexing suite v2 code +""" + +file_name = "indexing_suite/workaround.hpp" + code = """// Header file workaround.hpp // // Indexing-specific workarounds for compiler problems. @@ -56,6 +56,6 @@ # endif #endif // BOOST_PYTHON_INDEXING_WORKAROUND_HPP - - -""" + + +""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-13 11:43:29
|
Revision: 1799 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1799&view=rev Author: roman_yakovenko Date: 2010-01-13 11:43:23 +0000 (Wed, 13 Jan 2010) Log Message: ----------- add conditional registration of std:pair type Modified Paths: -------------- pyplusplus_dev/indexing_suite_v2/indexing_suite/pair.hpp Added Paths: ----------- pyplusplus_dev/indexing_suite_v2/indexing_suite/registry_utils.hpp Modified: pyplusplus_dev/indexing_suite_v2/indexing_suite/pair.hpp =================================================================== --- pyplusplus_dev/indexing_suite_v2/indexing_suite/pair.hpp 2010-01-13 10:38:19 UTC (rev 1798) +++ pyplusplus_dev/indexing_suite_v2/indexing_suite/pair.hpp 2010-01-13 11:43:23 UTC (rev 1799) @@ -20,6 +20,7 @@ #include <boost/config.hpp> #include <indexing_suite/container_traits.hpp> #include <indexing_suite/container_suite.hpp> +#include <indexing_suite/registry_utils.hpp> #include <indexing_suite/algorithms.hpp> #include <boost/detail/workaround.hpp> @@ -36,11 +37,16 @@ typedef pair_exposer_t< TValueType, TValueCallPolicies > exposer_type; pair_exposer_t(const std::string& name){ - class_< pair_type >( name.c_str() ) - .def( "__len__", &exposer_type::len ) - .def( "__getitem__", &exposer_type::get_item ) - .add_property( "key", &exposer_type::get_key ) - .add_property( "value", &exposer_type::get_mapped ); + if( boost::python::registry::utils::is_registered< pair_type >() ){ + boost::python::registry::utils::register_alias<pair_type>( name.c_str() ); + } + else{ + class_< pair_type >( name.c_str() ) + .def( "__len__", &exposer_type::len ) + .def( "__getitem__", &exposer_type::get_item ) + .add_property( "key", &exposer_type::get_key ) + .add_property( "value", &exposer_type::get_mapped ); + } } private: Added: pyplusplus_dev/indexing_suite_v2/indexing_suite/registry_utils.hpp =================================================================== --- pyplusplus_dev/indexing_suite_v2/indexing_suite/registry_utils.hpp (rev 0) +++ pyplusplus_dev/indexing_suite_v2/indexing_suite/registry_utils.hpp 2010-01-13 11:43:23 UTC (rev 1799) @@ -0,0 +1,41 @@ +// Header file registry_utils.hpp +// +// provides few convenience functions for dealing with boost:python registry +// +// Copyright (c) 2010 Roman Yakovenko +// +// Use, modification and distribution is subject to 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) +// +// History +// ======= +// 2010/01/12 Roman File creation +// + +#ifndef REGISTRY_UTILS_12_01_2010_HPP +#define REGISTRY_UTILS_12_01_2010_HPP + +#include <boost/config.hpp> +#include "boost/python.hpp" +#include "boost/python/converter/registry.hpp" + +namespace boost{ namespace python{ namespace registry{ namespace utils{ + +template<class T> +bool is_registered(){ + namespace bpl = boost::python; + bpl::handle<> class_obj( bpl::objects::registered_class_object( bpl::type_id< T >())); + return class_obj.get() ? true : false; +} + +template< class T > +void register_alias( const char* name ){ + namespace bpl = boost::python; + bpl::handle<> class_obj( bpl::objects::registered_class_object( bpl::type_id< T >())); + boost::python::scope().attr( name ) = bpl::object( class_obj ); +} + +}}}} + +#endif // REGISTRY_UTILS_12_01_2010_HPP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-13 10:38:29
|
Revision: 1798 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1798&view=rev Author: roman_yakovenko Date: 2010-01-13 10:38:19 +0000 (Wed, 13 Jan 2010) Log Message: ----------- integrating inout_static_matrix implementation Modified Paths: -------------- pyplusplus_dev/pyplusplus/function_transformers/transformers.py pyplusplus_dev/unittests/test_all.py Added Paths: ----------- pyplusplus_dev/unittests/data/ft_inout_static_matrix_to_be_exported.hpp pyplusplus_dev/unittests/ft_inout_static_matrix_tester.py Modified: pyplusplus_dev/pyplusplus/function_transformers/transformers.py =================================================================== --- pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2010-01-13 09:48:10 UTC (rev 1797) +++ pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2010-01-13 10:38:19 UTC (rev 1798) @@ -716,8 +716,9 @@ self.__configure_sealed( controller ) def configure_virtual_mem_fun( self, controller ): - self.__configure_v_mem_fun_override( controller.override_controller ) - self.__configure_v_mem_fun_default( controller.default_controller ) + raise RuntimeError( '"output_static_matrix" transformation does not support virtual functions yet.' ) + #self.__configure_v_mem_fun_override( controller.override_controller ) + #self.__configure_v_mem_fun_default( controller.default_controller ) # inout_static_matrix_t class inout_static_matrix_t(transformer.transformer_t): @@ -756,42 +757,46 @@ return [ code_repository.convenience.file_name ] def __configure_sealed(self, controller): - global _seq2arr - global _mat2seq + global _pymatrix2cmatrix + global _cmatrix2pymatrix w_arg = controller.find_wrapper_arg( self.arg.name ) w_arg.type = declarations.dummy_type_t( "boost::python::object" ) # Declare a variable that will hold the C matrix... native_matrix = controller.declare_variable( self.matrix_item_type , "native_" + self.arg.name - , '[%d][%d]' % (self.rows, self.columns) - ) + , '[%d][%d]' % (self.rows, self.columns) ) - pre_call = string.Template('pyplus_conv::ensure_uniform_sequence< $type >( $pylist, $array_size );') - controller.add_pre_call_code(pre_call.substitute(type='boost::python::list', pylist=w_arg.name,array_size=self.rows)) + conversion_code = _pymatrix2cmatrix.substitute( type=self.matrix_item_type + , pymatrix=w_arg.name + , columns='%d' % self.columns + , row=controller.register_variable_name( "row" ) + , rows='%d' % self.rows + , native_matrix=native_matrix ) - #TODO: may be a better idea is move this loop to the generated code. - for i in range(0,self.rows): - copy_pylist2arr = _seq2arr.substitute( type=self.matrix_item_type - , pylist=w_arg.name+"["+str(i)+"]" - , array_size=self.columns - , native_array=native_matrix+'['+str(i)+']' ) + controller.add_pre_call_code( conversion_code ) - controller.add_pre_call_code( copy_pylist2arr ) + controller.modify_arg_expression( self.arg_index, native_matrix ) + + #adding just declared variable to the original function call expression controller.modify_arg_expression( self.arg_index, native_matrix ) - pylist = controller.declare_variable( declarations.dummy_type_t( "boost::python::list" ) + # Declare a Python list which will receive the output... + pymatrix = controller.declare_variable( declarations.dummy_type_t( "boost::python::list" ) , 'py_' + self.arg.name ) - copy_mat2pylist = _mat2seq.substitute( native_matrix = native_matrix - , rows=self.rows - , columns=self.columns - , pylist=pylist) - controller.add_post_call_code( copy_mat2pylist ) + conversion_code = _cmatrix2pymatrix.substitute( pymatrix=pymatrix + , columns='%d' % self.columns + , row=controller.register_variable_name( "row" ) + , pyrow=controller.register_variable_name( "pyrow" ) + , rows='%d' % self.rows + , native_matrix=native_matrix ) + + controller.add_post_call_code( conversion_code ) #adding the variable to return variables list - controller.return_variable( pylist ) + controller.return_variable( pymatrix ) def __configure_v_mem_fun_default( self, controller ): self.__configure_sealed( controller ) @@ -815,8 +820,9 @@ self.__configure_sealed( controller ) def configure_virtual_mem_fun( self, controller ): - self.__configure_v_mem_fun_override( controller.override_controller ) - self.__configure_v_mem_fun_default( controller.default_controller ) + raise RuntimeError( '"output_static_matrix" transformation does not support virtual functions yet.' ) + #self.__configure_v_mem_fun_override( controller.override_controller ) + #self.__configure_v_mem_fun_default( controller.default_controller ) # input_c_buffer_t class input_c_buffer_t(transformer.transformer_t): Added: pyplusplus_dev/unittests/data/ft_inout_static_matrix_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/ft_inout_static_matrix_to_be_exported.hpp (rev 0) +++ pyplusplus_dev/unittests/data/ft_inout_static_matrix_to_be_exported.hpp 2010-01-13 10:38:19 UTC (rev 1798) @@ -0,0 +1,28 @@ +// Copyright 2004-2008 Roman Yakovenko. +// 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) + +#ifndef __ft_inout_static_matrix_to_be_exported_hpp__ +#define __ft_inout_static_matrix_to_be_exported_hpp__ + +#include <cmath> +#include <string> +#include <iostream> + +namespace ft{ + +int sum_and_fill( int m[2][3], int value ){ + int result = 0; + for( int r = 0; r < 2; ++r ){ + for( int c = 0; c < 3; ++c ){ + result += m[r][c]; + m[r][c] *= value; + } + } + return result; +} + +} + +#endif//__ft_inout_static_matrix_to_be_exported_hpp__ Added: pyplusplus_dev/unittests/ft_inout_static_matrix_tester.py =================================================================== --- pyplusplus_dev/unittests/ft_inout_static_matrix_tester.py (rev 0) +++ pyplusplus_dev/unittests/ft_inout_static_matrix_tester.py 2010-01-13 10:38:19 UTC (rev 1798) @@ -0,0 +1,49 @@ +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +import os +import sys +import math +import unittest +import fundamental_tester_base +from pygccxml import declarations +from pyplusplus import function_transformers as ft +from pyplusplus.module_builder import call_policies + +class tester_t(fundamental_tester_base.fundamental_tester_base_t): + EXTENSION_NAME = 'ft_inout_static_matrix' + + def __init__( self, *args ): + fundamental_tester_base.fundamental_tester_base_t.__init__( + self + , tester_t.EXTENSION_NAME + , *args ) + + def customize( self, mb ): + mb.global_ns.calldefs().create_with_signature = True + + sum_and_fill = mb.free_fun( 'sum_and_fill' ) + sum_and_fill.add_transformation( ft.inout_static_matrix('m', rows=2, columns=3) ) + + #calculate = mb.mem_fun( 'calculate' ) + #calculate.add_transformation( ft.input_static_matrix('m', rows=3, columns=5) ) + + def run_tests(self, module): + """Run the actual unit tests""" + m = [ [1, 2, 3], [4,5,6] ] + result = module.sum_and_fill( m, -1 ) + self.failUnless( 21 == result[0] ) + self.failUnless( [ [-1, -2, -3], [-4,-5,-6] ] == result[1]) + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t)) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() Modified: pyplusplus_dev/unittests/test_all.py =================================================================== --- pyplusplus_dev/unittests/test_all.py 2010-01-13 09:48:10 UTC (rev 1797) +++ pyplusplus_dev/unittests/test_all.py 2010-01-13 10:38:19 UTC (rev 1798) @@ -124,6 +124,7 @@ import indexing_suites2_support_tester import ft_input_static_matrix_tester import ft_output_static_matrix_tester +import ft_inout_static_matrix_tester testers = [ algorithms_tester @@ -236,6 +237,7 @@ , indexing_suites2_support_tester , ft_input_static_matrix_tester , ft_output_static_matrix_tester + , ft_inout_static_matrix_tester # , ogre_generate_tester too much time ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-13 09:48:27
|
Revision: 1797 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1797&view=rev Author: roman_yakovenko Date: 2010-01-13 09:48:10 +0000 (Wed, 13 Jan 2010) Log Message: ----------- integrate output_static_matrix Modified Paths: -------------- pyplusplus_dev/docs/documentation/functions/transformation/input_static_matrix.rest pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest pyplusplus_dev/pyplusplus/function_transformers/transformers.py pyplusplus_dev/unittests/test_all.py Added Paths: ----------- pyplusplus_dev/docs/documentation/functions/transformation/output_static_matrix.rest pyplusplus_dev/unittests/data/ft_output_static_matrix_to_be_exported.hpp pyplusplus_dev/unittests/ft_output_static_matrix_tester.py Modified: pyplusplus_dev/docs/documentation/functions/transformation/input_static_matrix.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/input_static_matrix.rest 2010-01-13 09:02:23 UTC (rev 1796) +++ pyplusplus_dev/docs/documentation/functions/transformation/input_static_matrix.rest 2010-01-13 09:48:10 UTC (rev 1797) @@ -13,7 +13,7 @@ "input_static_matrix" transformer takes as first argument name or index of the original function argument. The argument should have "array" or "pointer" type. -The second and the third arguments specfies rows and columns size. +The second and the third arguments specify rows and columns size. ----------- Limitations @@ -43,7 +43,7 @@ } -In order to expose ``sum`` function we need to create small wrapper: +In order to expose ``sum`` function we need to create a small wrapper: The following :doc:`Py++ <../../../pyplusplus>` code does it for you: .. code-block:: python Added: pyplusplus_dev/docs/documentation/functions/transformation/output_static_matrix.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/output_static_matrix.rest (rev 0) +++ pyplusplus_dev/docs/documentation/functions/transformation/output_static_matrix.rest 2010-01-13 09:48:10 UTC (rev 1797) @@ -0,0 +1,85 @@ +===================================== +``output_static_matrix`` transformer +===================================== + +---------- +Definition +---------- + +"output_static_matrix" transformer works on native 2D static arrays. +It handles the translation between a matrix and `Python`_ list object. +The matrix row and column sizes should be known in advance. + +"output_static_matrix" transformer takes as first argument name or index of the +original function argument. The argument should have "array" or "pointer" +type. The second and the third arguments specify rows and columns size. + +----------- +Limitations +----------- + +This transformer could not be applied on virtual functions. + + +------- +Example +------- + +.. code-block:: c++ + + void filler( int m[2][3], int value ){ + for( int r = 0; r < 2; ++r ){ + for( int c = 0; c < 3; ++c ){ + m[r][c] = value; + } + } + } + +In order to expose ``filler`` function we need to create a small wrapper. +The following :doc:`Py++ <../../../pyplusplus>` code does it for you: + + .. code-block:: python + + from pyplusplus import module_builder + from pyplusplus import function_transformers as FT + + mb = module_builder.module_builder_t( ... ) + filler = mb.free_fun( 'filler' ) + filler.add_transformation( ft.output_static_matrix('m', rows=2, columns=3) ) + +What you see below is the relevant pieces of generated code: + + .. code-block:: c++ + + #include "__convenience.pypp.hpp" //Py++ header file, which contains few convenience function + + namespace bp = boost::python; + + static boost::python::object filler_7b0a7cb8f4000f0474aa44d21c2e4917( int value ){ + int native_m[2][3]; + boost::python::list py_m; + ::ft::filler(native_m, value); + for (int row = 0; row < 2; ++row ){ + boost::python::list pyrow; + pyplus_conv::copy_container( native_m[row] + , native_m[row] + 3 + , pyplus_conv::list_inserter( pyrow ) ); + py_m.append( pyrow ); + } + return bp::object( py_m ); + } + + BOOST_PYTHON_MODULE(...){ + ... + typedef boost::python::object ( *filler_function_type )( int ); + + bp::def( + "filler" + , filler_function_type( &filler_7b0a7cb8f4000f0474aa44d21c2e4917 ) + , ( bp::arg("value") ) ); + } + +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html +.. _`Python`: http://www.python.org +.. _`GCC-XML`: http://www.gccxml.org + Modified: pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2010-01-13 09:02:23 UTC (rev 1796) +++ pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2010-01-13 09:48:10 UTC (rev 1797) @@ -96,6 +96,7 @@ input_c_buffer.rest from_address.rest input_static_matrix.rest + output_static_matrix.rest Modified: pyplusplus_dev/pyplusplus/function_transformers/transformers.py =================================================================== --- pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2010-01-13 09:02:23 UTC (rev 1796) +++ pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2010-01-13 09:48:10 UTC (rev 1797) @@ -262,11 +262,6 @@ _arr2seq = string.Template( 'pyplus_conv::copy_container( $native_array, $native_array + $array_size, pyplus_conv::list_inserter( $pylist ) );' ) -_mat2seq = string.Template( - 'for (int i=0; i<$rows; ++i) { boost::python::list ${pylist}_i; pyplus_conv::copy_container( $native_matrix[i], $native_matrix[i] + $columns, pyplus_conv::list_inserter( ${pylist}_i ) ); $pylist.append(${pylist}_i); }' ) - - - class input_static_array_t(transformer.transformer_t): """Handles an input array with fixed size. @@ -534,6 +529,17 @@ , ' pyplus_conv::copy_sequence( $pymatrix[$row], pyplus_conv::array_inserter( $native_matrix[$row], $columns ) );' , '}'])) + +_cmatrix2pymatrix = string.Template( os.linesep.join([ + 'for (int $row = 0; $row < $rows; ++$row ){' + , ' boost::python::list $pyrow;' + , ' pyplus_conv::copy_container( $native_matrix[$row]' + , ' , $native_matrix[$row] + $columns' + , ' , pyplus_conv::list_inserter( $pyrow ) );' + , ' $pymatrix.append( $pyrow ); ' + , '}' ])) + + # input_static_matrix_t class input_static_matrix_t(transformer.transformer_t): """Handles an input matrix with fixed size. @@ -654,31 +660,32 @@ return [ code_repository.convenience.file_name ] def __configure_sealed(self, controller): - global _mat2seq + global _cmatrix2pymatrix #removing arg from the function wrapper definition controller.remove_wrapper_arg( self.arg.name ) # Declare a variable that will hold the C matrix... native_matrix = controller.declare_variable( self.matrix_item_type , "native_" + self.arg.name - , '[%d][%d]' % (self.rows, self.columns) - ) + , '[%d][%d]' % (self.rows, self.columns ) ) #adding just declared variable to the original function call expression controller.modify_arg_expression( self.arg_index, native_matrix ) # Declare a Python list which will receive the output... - pylist = controller.declare_variable( declarations.dummy_type_t( "boost::python::list" ) + pymatrix = controller.declare_variable( declarations.dummy_type_t( "boost::python::list" ) , 'py_' + self.arg.name ) - copy_mat2pylist = _mat2seq.substitute( native_matrix = native_matrix, - rows=self.rows, - columns=self.columns, - pylist=pylist) + conversion_code = _cmatrix2pymatrix.substitute( pymatrix=pymatrix + , columns='%d' % self.columns + , row=controller.register_variable_name( "row" ) + , pyrow=controller.register_variable_name( "pyrow" ) + , rows='%d' % self.rows + , native_matrix=native_matrix ) - controller.add_post_call_code( copy_mat2pylist ) + controller.add_post_call_code( conversion_code ) #adding the variable to return variables list - controller.return_variable( pylist ) + controller.return_variable( pymatrix ) def __configure_v_mem_fun_default( self, controller ): self.__configure_sealed( controller ) Added: pyplusplus_dev/unittests/data/ft_output_static_matrix_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/ft_output_static_matrix_to_be_exported.hpp (rev 0) +++ pyplusplus_dev/unittests/data/ft_output_static_matrix_to_be_exported.hpp 2010-01-13 09:48:10 UTC (rev 1797) @@ -0,0 +1,25 @@ +// Copyright 2004-2008 Roman Yakovenko. +// 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) + +#ifndef __ft_output_static_matrix_to_be_exported_hpp__ +#define __ft_output_static_matrix_to_be_exported_hpp__ + +#include <cmath> +#include <string> +#include <iostream> + +namespace ft{ + +void filler( int m[2][3], int value ){ + for( int r = 0; r < 2; ++r ){ + for( int c = 0; c < 3; ++c ){ + m[r][c] = value; + } + } +} + +} + +#endif//__ft_output_static_matrix_to_be_exported_hpp__ Added: pyplusplus_dev/unittests/ft_output_static_matrix_tester.py =================================================================== --- pyplusplus_dev/unittests/ft_output_static_matrix_tester.py (rev 0) +++ pyplusplus_dev/unittests/ft_output_static_matrix_tester.py 2010-01-13 09:48:10 UTC (rev 1797) @@ -0,0 +1,47 @@ +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +import os +import sys +import math +import unittest +import fundamental_tester_base +from pygccxml import declarations +from pyplusplus import function_transformers as ft +from pyplusplus.module_builder import call_policies + +class tester_t(fundamental_tester_base.fundamental_tester_base_t): + EXTENSION_NAME = 'ft_output_static_matrix' + + def __init__( self, *args ): + fundamental_tester_base.fundamental_tester_base_t.__init__( + self + , tester_t.EXTENSION_NAME + , *args ) + + def customize( self, mb ): + mb.global_ns.calldefs().create_with_signature = True + + sum = mb.free_fun( 'filler' ) + sum.add_transformation( ft.output_static_matrix('m', rows=2, columns=3) ) + + + #calculate = mb.mem_fun( 'calculate' ) + #calculate.add_transformation( ft.input_static_matrix('m', rows=3, columns=5) ) + + def run_tests(self, module): + """Run the actual unit tests""" + self.failUnless( [[23,23,23],[23,23,23]] == module.filler( 23 ) ) + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t)) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() Modified: pyplusplus_dev/unittests/test_all.py =================================================================== --- pyplusplus_dev/unittests/test_all.py 2010-01-13 09:02:23 UTC (rev 1796) +++ pyplusplus_dev/unittests/test_all.py 2010-01-13 09:48:10 UTC (rev 1797) @@ -123,6 +123,7 @@ import ft_from_address_tester import indexing_suites2_support_tester import ft_input_static_matrix_tester +import ft_output_static_matrix_tester testers = [ algorithms_tester @@ -234,6 +235,7 @@ , ft_from_address_tester , indexing_suites2_support_tester , ft_input_static_matrix_tester + , ft_output_static_matrix_tester # , ogre_generate_tester too much time ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-13 09:02:29
|
Revision: 1796 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1796&view=rev Author: roman_yakovenko Date: 2010-01-13 09:02:23 +0000 (Wed, 13 Jan 2010) Log Message: ----------- integrate input_static_matrix Modified Paths: -------------- pyplusplus_dev/docs/documentation/functions/transformation/input_static_array.rest pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest pyplusplus_dev/pyplusplus/function_transformers/transformers.py pyplusplus_dev/unittests/ft_input_static_matrix_tester.py Added Paths: ----------- pyplusplus_dev/docs/documentation/functions/transformation/input_static_matrix.rest Modified: pyplusplus_dev/docs/documentation/functions/transformation/input_static_array.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/input_static_array.rest 2010-01-13 08:02:50 UTC (rev 1795) +++ pyplusplus_dev/docs/documentation/functions/transformation/input_static_array.rest 2010-01-13 09:02:23 UTC (rev 1796) @@ -12,7 +12,7 @@ "input_static_array" transformer takes as first argument name or index of the original function argument. The argument should have "array" or "pointer" type. -The second argument should an integer value, which represents array size. +The second argument should be an integer value, which represents array size. ------- Example Added: pyplusplus_dev/docs/documentation/functions/transformation/input_static_matrix.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/input_static_matrix.rest (rev 0) +++ pyplusplus_dev/docs/documentation/functions/transformation/input_static_matrix.rest 2010-01-13 09:02:23 UTC (rev 1796) @@ -0,0 +1,90 @@ +================================== +``input_static_matrix`` transformer +================================== + +---------- +Definition +---------- + +"input_static_matrix" transformer works on native static 2D arrays. It +handles the translation between `Python`_ object, passed as argument +that represent a sequence of sequences, and the matrix. The number of rows +and columns should be known in advance. + +"input_static_matrix" transformer takes as first argument name or index of the +original function argument. The argument should have "array" or "pointer" type. +The second and the third arguments specfies rows and columns size. + +----------- +Limitations +----------- + +This transformer could not be applied on virtual functions. + +------- +Example +------- + +.. code-block:: c++ + + template< int rows, int columns > + int sum_impl( const int m[rows][columns] ){ + int result = 0; + for( int r = 0; r < rows; ++r ){ + for( int c = 0; c < columns; ++c ){ + result += m[r][c]; + } + } + return result; + } + + int sum( int m[2][3]){ + return sum_impl<2, 3>( m ); + } + + +In order to expose ``sum`` function we need to create small wrapper: +The following :doc:`Py++ <../../../pyplusplus>` code does it for you: + + .. code-block:: python + + from pyplusplus import module_builder + from pyplusplus import function_transformers as FT + + mb = module_builder.module_builder_t( ... ) + sum = mb.free_fun( 'sum' ) + sum.add_transformation( FT.input_static_matrix('m', rows=2, columns=3) ) + +What you see below is the relevant pieces of generated code: + + .. code-block:: c++ + + #include "__convenience.pypp.hpp" //Py++ header file, which contains few convenience function + + namespace bp = boost::python; + + static boost::python::object sum_d4475c1b6a0ff117f0754ec5ecacdda3( boost::python::object m ){ + int native_m[2][3]; + pyplus_conv::ensure_uniform_sequence< boost::python::list >( m, 2 ); + for( size_t row = 0; row < 2; ++row ){ + pyplus_conv::ensure_uniform_sequence< int >( m[row], 3 ); + pyplus_conv::copy_sequence( m[row], pyplus_conv::array_inserter( native_m[row], 3 ) ); + } + int result = ::ft::sum(native_m); + return bp::object( result ); + } + + BOOST_PYTHON_MODULE(...){ + ... + typedef boost::python::object ( *sum_function_type )( boost::python::object ); + + bp::def( + "sum" + , sum_function_type( &sum_d4475c1b6a0ff117f0754ec5ecacdda3 ) + , ( bp::arg("m") ) ); + } + +.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html +.. _`Python`: http://www.python.org +.. _`GCC-XML`: http://www.gccxml.org + Modified: pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2010-01-13 08:02:50 UTC (rev 1795) +++ pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2010-01-13 09:02:23 UTC (rev 1796) @@ -95,6 +95,7 @@ transfer_ownership.rest input_c_buffer.rest from_address.rest + input_static_matrix.rest Modified: pyplusplus_dev/pyplusplus/function_transformers/transformers.py =================================================================== --- pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2010-01-13 08:02:50 UTC (rev 1795) +++ pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2010-01-13 09:02:23 UTC (rev 1796) @@ -612,8 +612,9 @@ self.__configure_sealed( controller ) def configure_virtual_mem_fun( self, controller ): - self.__configure_v_mem_fun_override( controller.override_controller ) - self.__configure_v_mem_fun_default( controller.default_controller ) + raise RuntimeError( '"input_static_matrix" transformation does not support virtual functions yet.' ) + #self.__configure_v_mem_fun_override( controller.override_controller ) + #self.__configure_v_mem_fun_default( controller.default_controller ) # output_static_matrix_t class output_static_matrix_t(transformer.transformer_t): Modified: pyplusplus_dev/unittests/ft_input_static_matrix_tester.py =================================================================== --- pyplusplus_dev/unittests/ft_input_static_matrix_tester.py 2010-01-13 08:02:50 UTC (rev 1795) +++ pyplusplus_dev/unittests/ft_input_static_matrix_tester.py 2010-01-13 09:02:23 UTC (rev 1796) @@ -31,8 +31,8 @@ sum = mb.free_funs( lambda d: d.name in ('sum', 'sum_const' ) ) sum.add_transformation( ft.input_static_matrix('m', rows=2, columns=3) ) - calculate = mb.mem_fun( 'calculate' ) - calculate.add_transformation( ft.input_static_matrix('m', rows=3, columns=5) ) + #calculate = mb.mem_fun( 'calculate' ) + #calculate.add_transformation( ft.input_static_matrix('m', rows=3, columns=5) ) def run_tests(self, module): """Run the actual unit tests""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-13 08:02:59
|
Revision: 1795 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1795&view=rev Author: roman_yakovenko Date: 2010-01-13 08:02:50 +0000 (Wed, 13 Jan 2010) Log Message: ----------- small fixes Modified Paths: -------------- pyplusplus_dev/unittests/test_all.py Modified: pyplusplus_dev/unittests/test_all.py =================================================================== --- pyplusplus_dev/unittests/test_all.py 2010-01-07 20:22:54 UTC (rev 1794) +++ pyplusplus_dev/unittests/test_all.py 2010-01-13 08:02:50 UTC (rev 1795) @@ -120,9 +120,9 @@ import function_adaptor_tester import selection_bug_tester #import ogre_generate_tester -import ft_from_address +import ft_from_address_tester import indexing_suites2_support_tester -import ft_input_static_matrix +import ft_input_static_matrix_tester testers = [ algorithms_tester @@ -231,9 +231,9 @@ , return_ref_to_ptr_tester , function_adaptor_tester , selection_bug_tester - , ft_from_address + , ft_from_address_tester , indexing_suites2_support_tester - , ft_input_static_matrix + , ft_input_static_matrix_tester # , ogre_generate_tester too much time ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2010-01-07 20:23:01
|
Revision: 1794 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1794&view=rev Author: roman_yakovenko Date: 2010-01-07 20:22:54 +0000 (Thu, 07 Jan 2010) Log Message: ----------- misc: allow the process to continue, even in case the binary parser can not find the relevant declaration Modified Paths: -------------- pygccxml_dev/pygccxml/binary_parsers/parsers.py Modified: pygccxml_dev/pygccxml/binary_parsers/parsers.py =================================================================== --- pygccxml_dev/pygccxml/binary_parsers/parsers.py 2009-12-28 21:24:49 UTC (rev 1793) +++ pygccxml_dev/pygccxml/binary_parsers/parsers.py 2010-01-07 20:22:54 UTC (rev 1794) @@ -23,6 +23,7 @@ import warnings import exceptions import subprocess +from pygccxml import utils from pygccxml import declarations class LicenseWarning( exceptions.UserWarning ): @@ -95,10 +96,13 @@ self.__loaded_symbols = self.load_symbols() result = {} for smbl in self.__loaded_symbols: - decorated, decl = self.merge( smbl ) - if decl: - decl.decorated_name = decorated - result[ decorated ] = decl + try: + decorated, decl = self.merge( smbl ) + if decl: + decl.decorated_name = decorated + result[ decorated ] = decl + except declarations.matcher.declaration_not_found_t: + pass return result CCTS = declarations.CALLING_CONVENTION_TYPES This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2009-12-28 21:24:58
|
Revision: 1793 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1793&view=rev Author: roman_yakovenko Date: 2009-12-28 21:24:49 +0000 (Mon, 28 Dec 2009) Log Message: ----------- add "ignore" "binaries" directory Property Changed: ---------------- pyplusplus_dev/unittests/data/ctypes/user_code/ Property changes on: pyplusplus_dev/unittests/data/ctypes/user_code ___________________________________________________________________ Added: svn:ignore + binaries This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2009-12-28 21:23:16
|
Revision: 1792 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1792&view=rev Author: roman_yakovenko Date: 2009-12-28 21:23:02 +0000 (Mon, 28 Dec 2009) Log Message: ----------- add ability to generate the user code in a module head/tail Modified Paths: -------------- pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py pyplusplus_dev/pyplusplus/module_builder/ctypes_builder.py pyplusplus_dev/unittests/ctypes_tester.py pyplusplus_dev/unittests/sconstruct Added Paths: ----------- pyplusplus_dev/unittests/data/ctypes/user_code/ pyplusplus_dev/unittests/data/ctypes/user_code/sconscript pyplusplus_dev/unittests/data/ctypes/user_code/user_code.cpp pyplusplus_dev/unittests/data/ctypes/user_code/user_code.h Modified: pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py 2009-12-28 21:17:07 UTC (rev 1791) +++ pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py 2009-12-28 21:23:02 UTC (rev 1792) @@ -190,22 +190,22 @@ @property def declarations_code_head( self ): - "List of user code, that will be added to the head of the declarations section." + "A list of the user code, which will be added to the head of the declarations section." return self.__declarations_code_head @property def declarations_code_tail( self ): - "List of user code, that will be added to the tail of the declarations section." + "A list of the user code, which will be added to the tail of the declarations section." return self.__declarations_code_tail @property def registrations_code_head( self ): - "List of user code, that will be added to the head of the registrations section." + "A list of the user code, which will be added to the head of the registrations section." return self.__registrations_code_head @property def registrations_code_tail( self ): - "List of user code, that will be added to the tail of the registrations section." + "A list of the user code, which will be added to the tail of the registrations section." return self.__registrations_code_tail def build_code_creator( self @@ -259,12 +259,14 @@ return not ( None is self.__code_creator ) def add_declaration_code( self, code, tail=True ): + """adds the user code to the generated one""" if tail: self.__declarations_code_tail.append( code ) else: self.__declarations_code_head.append( code ) def add_registration_code( self, code, tail=True ): + """adds the user code to the generated one""" if tail: self.__registrations_code_tail.append( code ) else: Modified: pyplusplus_dev/pyplusplus/module_builder/ctypes_builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/ctypes_builder.py 2009-12-28 21:17:07 UTC (rev 1791) +++ pyplusplus_dev/pyplusplus/module_builder/ctypes_builder.py 2009-12-28 21:23:02 UTC (rev 1792) @@ -49,6 +49,9 @@ self.__treat_char_ptr_as_binary_data = None + self.__module_code_head = [] + self.__module_code_tail = [] + def __parse_declarations( self, files, gccxml_config, compilation_mode=None, cache=None ): if None is gccxml_config: gccxml_config = parser.config_t() @@ -94,6 +97,23 @@ treat_char_ptr_as_binary_data = property( __get_treat_char_ptr_as_binary_data, __set_treat_char_ptr_as_binary_data, doc="""If True, Py++ will generate "POINTER( char )", instead of "c_char_p" for "char*" type. By default it is False""" ) + @property + def module_code_head( self ): + "A list of the user code, which will be added to the top of the module" + return self.__module_code_head + + @property + def module_code_tail( self ): + "A list of the user code, which will be added to the bottom of the module" + return self.__module_code_tail + + def add_module_code( self, code, tail=True ): + """adds the user code to the generated one""" + if tail: + self.__module_code_tail.append( code ) + else: + self.__module_code_head.append( code ) + def build_code_creator( self, library_path, doc_extractor=None ): creator = creators_factory.ctypes_creator_t( self.global_ns , library_path @@ -117,6 +137,13 @@ """ return not ( None is self.__code_creator ) + def __merge_user_code( self ): + for code in self.module_code_tail: + self.code_creator.adopt_creator( code_creators.custom_text_t( code ) ) + + for code in self.module_code_head: + self.code_creator.adopt_creator( code_creators.custom_text_t( code ), 0 ) + def write_module( self, file_name ): """ Writes module to single file @@ -125,6 +152,7 @@ :type file_name: string """ + self.__merge_user_code() file_writers.write_file( self.code_creator, file_name, encoding=self.encoding ) Modified: pyplusplus_dev/unittests/ctypes_tester.py =================================================================== --- pyplusplus_dev/unittests/ctypes_tester.py 2009-12-28 21:17:07 UTC (rev 1791) +++ pyplusplus_dev/unittests/ctypes_tester.py 2009-12-28 21:23:02 UTC (rev 1792) @@ -229,6 +229,28 @@ self.failUnless( data.contents.size == len( "hello world" ) ) self.failUnless( data.contents.bytes[0:data.contents.size + 1] == "hello\0world\0" ) +class user_code_tester_t( ctypes_base_tester_t ): + def __init__( self, *args, **keywd ): + ctypes_base_tester_t.__init__( self, 'user_code', *args, **keywd ) + self.module_top_code = "top = 'top'" + self.module_bottom_code = "bottom = 'bottom'" + + def customize(self, mb ): + mb.add_module_code( self.module_top_code, tail=False ) + mb.add_module_code( self.module_bottom_code, tail=True ) + + def test(self): + self.failUnless( self.module_ref.top == "top" ) + self.failUnless( self.module_ref.bottom == "bottom" ) + content = [] + for line in file( self.module_ref.__file__ ): + if line.lstrip().startswith( '#' ) or not line.strip(): + continue + else: + content.append( line.rstrip() ) + self.failUnless( content[0] == self.module_top_code ) + self.failUnless( content[-1] == self.module_bottom_code ) + def create_suite(): #part of this functionality is going to be deprecated suite = unittest.TestSuite() @@ -241,6 +263,7 @@ suite.addTest( unittest.makeSuite(circular_references_tester_t)) suite.addTest( unittest.makeSuite(function_ptr_as_variable_tester_t)) suite.addTest( unittest.makeSuite(char_ptr_as_binary_data_tester_t)) + suite.addTest( unittest.makeSuite(user_code_tester_t)) return suite def run_suite(): Added: pyplusplus_dev/unittests/data/ctypes/user_code/sconscript =================================================================== --- pyplusplus_dev/unittests/data/ctypes/user_code/sconscript (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/user_code/sconscript 2009-12-28 21:23:02 UTC (rev 1792) @@ -0,0 +1,7 @@ +Import('*') + +target_name = 'user_code' +shlib = env.SharedLibrary( target=target_name + , source=[ target_name + '.cpp' ] + , CPPPATH=['#data'] ) +env.Alias( target_name, shlib ) Added: pyplusplus_dev/unittests/data/ctypes/user_code/user_code.cpp =================================================================== --- pyplusplus_dev/unittests/data/ctypes/user_code/user_code.cpp (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/user_code/user_code.cpp 2009-12-28 21:23:02 UTC (rev 1792) @@ -0,0 +1,5 @@ +#include "user_code.h" + +EXPORT_SYMBOL void init(){ +} + Added: pyplusplus_dev/unittests/data/ctypes/user_code/user_code.h =================================================================== --- pyplusplus_dev/unittests/data/ctypes/user_code/user_code.h (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/user_code/user_code.h 2009-12-28 21:23:02 UTC (rev 1792) @@ -0,0 +1,11 @@ +#include "libconfig.h" + +struct EXPORT_SYMBOL data_t{ + int i; + unsigned int j : 3; +}; + +EXPORT_SYMBOL int j; + +EXPORT_SYMBOL void init(); + Modified: pyplusplus_dev/unittests/sconstruct =================================================================== --- pyplusplus_dev/unittests/sconstruct 2009-12-28 21:17:07 UTC (rev 1791) +++ pyplusplus_dev/unittests/sconstruct 2009-12-28 21:23:02 UTC (rev 1792) @@ -33,7 +33,8 @@ , 'varargs' , 'templates' , 'circular_references' - , 'function_ptr_as_variable' + , 'function_ptr_as_variable' + , 'user_code' , 'char_ptr_as_binary_data' ] for s in scripts: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2009-12-28 21:17:14
|
Revision: 1791 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1791&view=rev Author: roman_yakovenko Date: 2009-12-28 21:17:07 +0000 (Mon, 28 Dec 2009) Log Message: ----------- updating example to the version 3.5 p Modified Paths: -------------- pyplusplus_dev/examples/gmplib_dev/dev/project_env.py pyplusplus_dev/examples/gmplib_dev/pygmplib/__init__.py Modified: pyplusplus_dev/examples/gmplib_dev/dev/project_env.py =================================================================== --- pyplusplus_dev/examples/gmplib_dev/dev/project_env.py 2009-12-27 21:15:38 UTC (rev 1790) +++ pyplusplus_dev/examples/gmplib_dev/dev/project_env.py 2009-12-28 21:17:07 UTC (rev 1791) @@ -6,6 +6,6 @@ class gmp: header_file = '/usr/include/gmp.h' - symbols_file = '/usr/lib/libgmp.so.3.4.4' - shared_library_file = '/usr/lib/libgmp.so.3.4.4' + symbols_file = '/usr/lib/libgmp.so.3.5.0' + shared_library_file = '/usr/lib/libgmp.so.3.5.0' generated_code_dir = complete_path( 'pyplusplus_dev', 'examples', 'gmplib_dev', 'pygmplib' ) Modified: pyplusplus_dev/examples/gmplib_dev/pygmplib/__init__.py =================================================================== --- pyplusplus_dev/examples/gmplib_dev/pygmplib/__init__.py 2009-12-27 21:15:38 UTC (rev 1790) +++ pyplusplus_dev/examples/gmplib_dev/pygmplib/__init__.py 2009-12-28 21:17:07 UTC (rev 1791) @@ -4,63 +4,66 @@ import ctypes_utils -libgmp_lib = ctypes.CDLL( r"/usr/lib/libgmp.so.3.4.4" ) +libgmp_lib = ctypes.CDLL( r"/usr/lib/libgmp.so.3.5.0" ) libgmp_lib.undecorated_names = {#mapping between decorated and undecorated names "extern double __gmpf_get_d(mpf_srcptr arg0) [free function]" : "__gmpf_get_d", "extern int __gmpf_cmp_ui(mpf_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpf_cmp_ui", - "extern void __gmpz_fac_ui(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_fac_ui", + "extern void __gmpz_mul_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_mul_ui", "extern void __gmpz_and(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_and", "extern void __gmpf_urandomb(__mpf_struct * arg0, __gmp_randstate_struct * arg1, long unsigned int arg2) [free function]" : "__gmpf_urandomb", - "extern mp_limb_t __gmpn_mul_1(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, mp_limb_t arg3) [free function]" : "__gmpn_mul_1", - "extern void __gmpz_mul_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_mul_2exp", + "extern long unsigned int __gmpz_tdiv_q_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_tdiv_q_ui", "extern void __gmpz_clrbit(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_clrbit", "extern void __gmpz_cdiv_r_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_cdiv_r_2exp", "extern void __gmpz_lcm(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_lcm", - "extern void __gmpz_gcd(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_gcd", + "extern double __gmpf_get_d_2exp(long int * arg0, mpf_srcptr arg1) [free function]" : "__gmpf_get_d_2exp", "extern int __gmpz_divisible_2exp_p(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_divisible_2exp_p", "extern int __gmpz_congruent_2exp_p(mpz_srcptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_congruent_2exp_p", "extern void __gmpz_pow_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_pow_ui", "void __gmpq_neg(mpq_ptr __gmp_w, mpq_srcptr __gmp_u) [free function]" : "__gmpq_neg", + "extern void __gmpf_reldiff(mpf_ptr arg0, mpf_srcptr arg1, mpf_srcptr arg2) [free function]" : "__gmpf_reldiff", "extern void __gmpz_import(mpz_ptr arg0, size_t arg1, int arg2, size_t arg3, int arg4, size_t arg5, void const * arg6) [free function]" : "__gmpz_import", - "extern long unsigned int __gmpz_fdiv_ui(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_fdiv_ui", + "extern void __gmpz_fac_ui(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_fac_ui", "extern int __gmpz_root(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_root", "extern void __gmpz_fdiv_q(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_fdiv_q", "extern void __gmpz_fdiv_r(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_fdiv_r", - "extern size_t __gmpq_inp_str(mpq_ptr arg0, FILE * arg1, int arg2) [free function]" : "__gmpq_inp_str", - "extern int __gmpz_ui_kronecker(long unsigned int arg0, mpz_srcptr arg1) [free function]" : "__gmpz_ui_kronecker", - "extern long unsigned int __gmpz_remove(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_remove", - "extern int __gmpz_tstbit(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_tstbit", + "extern void __gmp_set_memory_functions(void * (*)( ::size_t ) * arg0, void * (*)( void *,::size_t,::size_t ) * arg1, void (*)( void *,::size_t ) * arg2) [free function]" : "__gmp_set_memory_functions", + "extern long unsigned int __gmpz_tdiv_r_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_tdiv_r_ui", + "extern long unsigned int __gmpz_cdiv_r_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_cdiv_r_ui", + "extern void __gmpz_realloc2(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_realloc2", "extern void __gmpn_tdiv_qr(mp_ptr arg0, mp_ptr arg1, mp_size_t arg2, mp_srcptr arg3, mp_size_t arg4, mp_srcptr arg5, mp_size_t arg6) [free function]" : "__gmpn_tdiv_qr", "extern void __gmpz_fdiv_r_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_fdiv_r_2exp", - "extern void __gmpf_div(mpf_ptr arg0, mpf_srcptr arg1, mpf_srcptr arg2) [free function]" : "__gmpf_div", + "extern void __gmpz_sqrt(mpz_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_sqrt", + "extern void __gmpq_add(mpq_ptr arg0, mpq_srcptr arg1, mpq_srcptr arg2) [free function]" : "__gmpq_add", "extern void __gmpq_div(mpq_ptr arg0, mpq_srcptr arg1, mpq_srcptr arg2) [free function]" : "__gmpq_div", - "extern void __gmpz_ui_pow_ui(mpz_ptr arg0, long unsigned int arg1, long unsigned int arg2) [free function]" : "__gmpz_ui_pow_ui", + "extern long unsigned int __gmpf_get_default_prec() [free function]" : "__gmpf_get_default_prec", "extern void __gmpq_sub(mpq_ptr arg0, mpq_srcptr arg1, mpq_srcptr arg2) [free function]" : "__gmpq_sub", "extern void __gmpf_set_ui(mpf_ptr arg0, long unsigned int arg1) [free function]" : "__gmpf_set_ui", - "extern mp_limb_t __gmpn_lshift(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, unsigned int arg3) [free function]" : "__gmpn_lshift", + "extern double __gmpz_get_d(mpz_srcptr arg0) [free function]" : "__gmpz_get_d", "extern void __gmpz_add(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_add", - "extern void __gmpf_trunc(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_trunc", + "int __gmpn_cmp(mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) [free function]" : "__gmpn_cmp", "extern void __gmpz_divexact_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_divexact_ui", "extern long unsigned int __gmpz_gcd_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_gcd_ui", - "extern void __gmpz_cdiv_r(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_cdiv_r", "extern size_t __gmpz_inp_str(mpz_ptr arg0, FILE * arg1, int arg2) [free function]" : "__gmpz_inp_str", - "extern double __gmpq_get_d(mpq_srcptr arg0) [free function]" : "__gmpq_get_d", - "extern int __gmp_sprintf(char * arg0, char const * arg1, ...) [free function]" : "__gmp_sprintf", - "extern void __gmpn_random2(mp_ptr arg0, mp_size_t arg1) [free function]" : "__gmpn_random2", + "extern int __gmp_snprintf(char * arg0, size_t arg1, char const * arg2, ...) [free function]" : "__gmp_snprintf", + "extern void __gmpf_set_prec_raw(mpf_ptr arg0, long unsigned int arg1) [free function]" : "__gmpf_set_prec_raw", "extern void __gmpz_cdiv_q_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_cdiv_q_2exp", - "extern int __gmpf_eq(mpf_srcptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_eq", + "extern int __gmpz_fits_sshort_p(mpz_srcptr arg0) [free function]" : "__gmpz_fits_sshort_p", "extern mp_limb_t __gmpn_divrem(mp_ptr arg0, mp_size_t arg1, mp_ptr arg2, mp_size_t arg3, mp_srcptr arg4, mp_size_t arg5) [free function]" : "__gmpn_divrem", - "extern void __gmpz_cdiv_q(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_cdiv_q", - "void __gmpz_abs(mpz_ptr __gmp_w, mpz_srcptr __gmp_u) [free function]" : "__gmpz_abs", + "extern void __gmpz_submul(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_submul", + "extern void __gmpz_init_set(mpz_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_init_set", "extern void __gmpz_xor(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_xor", "extern void __gmpz_init_set_d(mpz_ptr arg0, double arg1) [free function]" : "__gmpz_init_set_d", "int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z) [free function]" : "__gmpz_fits_ushort_p", - "extern void __gmpq_set_f(mpq_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpq_set_f", + "extern int __gmp_sscanf(char const * arg0, char const * arg1, ...) [free function]" : "__gmp_sscanf", + "extern void __gmpz_mul_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_mul_2exp", + "extern void __gmpz_sub(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_sub", "extern int __gmpf_fits_ulong_p(mpf_srcptr arg0) [free function]" : "__gmpf_fits_ulong_p", + "extern void __gmpz_ui_pow_ui(mpz_ptr arg0, long unsigned int arg1, long unsigned int arg2) [free function]" : "__gmpz_ui_pow_ui", + "extern long unsigned int __gmp_urandomm_ui(__gmp_randstate_struct * arg0, long unsigned int arg1) [free function]" : "__gmp_urandomm_ui", "long unsigned int __gmpz_get_ui(mpz_srcptr __gmp_z) [free function]" : "__gmpz_get_ui", "extern int __gmpz_cmpabs_ui(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_cmpabs_ui", - "extern long unsigned int __gmp_urandomm_ui(__gmp_randstate_struct * arg0, long unsigned int arg1) [free function]" : "__gmp_urandomm_ui", + "extern void __gmpz_tdiv_q_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_tdiv_q_2exp", "int __gmpz_perfect_square_p(mpz_srcptr __gmp_a) [free function]" : "__gmpz_perfect_square_p", "extern void __gmpq_set_d(mpq_ptr arg0, double arg1) [free function]" : "__gmpq_set_d", "extern int __gmpz_cmp_d(mpz_srcptr arg0, double arg1) [free function]" : "__gmpz_cmp_d", @@ -69,13 +72,13 @@ "extern int __gmpz_probab_prime_p(mpz_srcptr arg0, int arg1) [free function]" : "__gmpz_probab_prime_p", "extern mp_limb_t __gmpn_rshift(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, unsigned int arg3) [free function]" : "__gmpn_rshift", "extern void __gmpz_array_init(mpz_ptr arg0, mp_size_t arg1, mp_size_t arg2) [free function]" : "__gmpz_array_init", - "extern long unsigned int __gmpf_get_default_prec() [free function]" : "__gmpf_get_default_prec", + "int __gmpz_fits_uint_p(mpz_srcptr __gmp_z) [free function]" : "__gmpz_fits_uint_p", "extern void __gmpf_random2(mpf_ptr arg0, mp_size_t arg1, mp_exp_t arg2) [free function]" : "__gmpf_random2", "extern void __gmp_randinit_set(__gmp_randstate_struct * arg0, __gmp_randstate_struct const * arg1) [free function]" : "__gmp_randinit_set", - "extern void __gmpq_inv(mpq_ptr arg0, mpq_srcptr arg1) [free function]" : "__gmpq_inv", + "extern void __gmpz_tdiv_qr(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2, mpz_srcptr arg3) [free function]" : "__gmpz_tdiv_qr", "extern mp_size_t __gmpn_set_str(mp_ptr arg0, unsigned char const * arg1, size_t arg2, int arg3) [free function]" : "__gmpn_set_str", - "extern void __gmp_randinit(__gmp_randstate_struct * arg0, gmp_randalg_t arg1, ...) [free function]" : "__gmp_randinit", - "extern mp_size_t __gmpn_sqrtrem(mp_ptr arg0, mp_ptr arg1, mp_srcptr arg2, mp_size_t arg3) [free function]" : "__gmpn_sqrtrem", + "extern long unsigned int __gmpn_scan0(mp_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpn_scan0", + "extern void __gmpz_cdiv_r(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_cdiv_r", "extern long unsigned int __gmpz_fdiv_qr_ui(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2, long unsigned int arg3) [free function]" : "__gmpz_fdiv_qr_ui", "extern void __gmpf_init_set_ui(mpf_ptr arg0, long unsigned int arg1) [free function]" : "__gmpf_init_set_ui", "extern void __gmpn_mul_n(mp_ptr arg0, mp_srcptr arg1, mp_srcptr arg2, mp_size_t arg3) [free function]" : "__gmpn_mul_n", @@ -84,88 +87,88 @@ "extern void __gmpq_set_si(mpq_ptr arg0, long int arg1, long unsigned int arg2) [free function]" : "__gmpq_set_si", "extern void __gmpq_set_ui(mpq_ptr arg0, long unsigned int arg1, long unsigned int arg2) [free function]" : "__gmpq_set_ui", "extern void __gmpf_sqrt_ui(mpf_ptr arg0, long unsigned int arg1) [free function]" : "__gmpf_sqrt_ui", - "extern void __gmpz_init_set_ui(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_init_set_ui", - "extern int __gmpz_divisible_ui_p(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_divisible_ui_p", + "extern size_t __gmpq_inp_str(mpq_ptr arg0, FILE * arg1, int arg2) [free function]" : "__gmpq_inp_str", + "extern int __gmpf_fits_sint_p(mpf_srcptr arg0) [free function]" : "__gmpf_fits_sint_p", "extern void __gmpq_swap(mpq_ptr arg0, mpq_ptr arg1) [free function]" : "__gmpq_swap", "extern int __gmpf_set_str(mpf_ptr arg0, char const * arg1, int arg2) [free function]" : "__gmpf_set_str", "extern void __gmpz_sub_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_sub_ui", "extern void __gmpz_divexact(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_divexact", "extern void __gmpz_com(mpz_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_com", "extern void __gmpz_ior(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_ior", - "extern void __gmpz_init_set(mpz_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_init_set", - "extern long unsigned int __gmpz_cdiv_q_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_cdiv_q_ui", - "extern void __gmpz_submul(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_submul", + "extern int __gmpz_fits_slong_p(mpz_srcptr arg0) [free function]" : "__gmpz_fits_slong_p", "extern int __gmp_asprintf(char * * arg0, char const * arg1, ...) [free function]" : "__gmp_asprintf", "__gmp_bits_per_limb [variable]" : "__gmp_bits_per_limb", - "extern int __gmp_scanf(char const * arg0, ...) [free function]" : "__gmp_scanf", "extern void __gmpf_set_prec(mpf_ptr arg0, long unsigned int arg1) [free function]" : "__gmpf_set_prec", "extern int __gmpz_init_set_str(mpz_ptr arg0, char const * arg1, int arg2) [free function]" : "__gmpz_init_set_str", "mp_limb_t __gmpn_sub_1(mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) [free function]" : "__gmpn_sub_1", "extern int __gmpz_millerrabin(mpz_srcptr arg0, int arg1) [free function]" : "__gmpz_millerrabin", "extern void __gmpz_mod(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_mod", "extern int __gmpz_invert(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_invert", + "extern void __gmp_randinit_mt(__gmp_randstate_struct * arg0) [free function]" : "__gmp_randinit_mt", "extern void __gmpf_set_d(mpf_ptr arg0, double arg1) [free function]" : "__gmpf_set_d", - "extern int __gmpf_fits_uint_p(mpf_srcptr arg0) [free function]" : "__gmpf_fits_uint_p", + "extern void __gmpf_sub(mpf_ptr arg0, mpf_srcptr arg1, mpf_srcptr arg2) [free function]" : "__gmpf_sub", "extern mp_limb_t __gmpn_addmul_1(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, mp_limb_t arg3) [free function]" : "__gmpn_addmul_1", "extern void __gmpf_set_z(mpf_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpf_set_z", "extern void __gmpz_ui_sub(mpz_ptr arg0, long unsigned int arg1, mpz_srcptr arg2) [free function]" : "__gmpz_ui_sub", - "extern double __gmpz_get_d(mpz_srcptr arg0) [free function]" : "__gmpz_get_d", - "extern void __gmpf_set_prec_raw(mpf_ptr arg0, long unsigned int arg1) [free function]" : "__gmpf_set_prec_raw", - "extern int __gmpf_cmp(mpf_srcptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_cmp", + "extern void __gmpf_div(mpf_ptr arg0, mpf_srcptr arg1, mpf_srcptr arg2) [free function]" : "__gmpf_div", + "extern void __gmpn_random2(mp_ptr arg0, mp_size_t arg1) [free function]" : "__gmpn_random2", + "extern mp_limb_t __gmpn_divexact_by3c(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, mp_limb_t arg3) [free function]" : "__gmpn_divexact_by3c", "extern void __gmpz_lucnum_ui(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_lucnum_ui", "extern void __gmpf_set_q(mpf_ptr arg0, mpq_srcptr arg1) [free function]" : "__gmpf_set_q", - "extern mp_limb_t __gmpn_gcd_1(mp_srcptr arg0, mp_size_t arg1, mp_limb_t arg2) [free function]" : "__gmpn_gcd_1", - "extern void __gmpz_tdiv_qr(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2, mpz_srcptr arg3) [free function]" : "__gmpz_tdiv_qr", + "extern void __gmpz_random(mpz_ptr arg0, mp_size_t arg1) [free function]" : "__gmpz_random", + "extern int __gmp_scanf(char const * arg0, ...) [free function]" : "__gmp_scanf", + "extern mp_size_t __gmpn_sqrtrem(mp_ptr arg0, mp_ptr arg1, mp_srcptr arg2, mp_size_t arg3) [free function]" : "__gmpn_sqrtrem", "extern int __gmpq_set_str(mpq_ptr arg0, char const * arg1, int arg2) [free function]" : "__gmpq_set_str", "extern int __gmpf_fits_slong_p(mpf_srcptr arg0) [free function]" : "__gmpf_fits_slong_p", "extern void __gmpz_setbit(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_setbit", "extern void __gmp_randinit_lc_2exp(__gmp_randstate_struct * arg0, mpz_srcptr arg1, long unsigned int arg2, long unsigned int arg3) [free function]" : "__gmp_randinit_lc_2exp", "extern int __gmp_randinit_lc_2exp_size(__gmp_randstate_struct * arg0, long unsigned int arg1) [free function]" : "__gmp_randinit_lc_2exp_size", - "extern int __gmpf_cmp_si(mpf_srcptr arg0, long int arg1) [free function]" : "__gmpf_cmp_si", - "extern void __gmp_randclear(__gmp_randstate_struct * arg0) [free function]" : "__gmp_randclear", + "extern void __gmpz_set_d(mpz_ptr arg0, double arg1) [free function]" : "__gmpz_set_d", + "extern int __gmpz_jacobi(mpz_srcptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_jacobi", "extern void __gmpz_set_f(mpz_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpz_set_f", "extern size_t __gmpf_out_str(FILE * arg0, int arg1, size_t arg2, mpf_srcptr arg3) [free function]" : "__gmpf_out_str", "extern int __gmpf_fits_sshort_p(mpf_srcptr arg0) [free function]" : "__gmpf_fits_sshort_p", "extern void __gmpq_div_2exp(mpq_ptr arg0, mpq_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpq_div_2exp", "extern long unsigned int __gmpf_get_prec(mpf_srcptr arg0) [free function]" : "__gmpf_get_prec", - "extern void __gmpq_init(mpq_ptr arg0) [free function]" : "__gmpq_init", "extern int __gmpz_kronecker_si(mpz_srcptr arg0, long int arg1) [free function]" : "__gmpz_kronecker_si", - "extern int __gmpz_fits_sint_p(mpz_srcptr arg0) [free function]" : "__gmpz_fits_sint_p", - "extern int __gmp_snprintf(char * arg0, size_t arg1, char const * arg2, ...) [free function]" : "__gmp_snprintf", + "extern void __gmpf_floor(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_floor", + "extern int __gmpq_cmp(mpq_srcptr arg0, mpq_srcptr arg1) [free function]" : "__gmpq_cmp", + "extern int __gmpf_integer_p(mpf_srcptr arg0) [free function]" : "__gmpf_integer_p", "extern void __gmpz_powm(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2, mpz_srcptr arg3) [free function]" : "__gmpz_powm", "extern long unsigned int __gmpz_hamdist(mpz_srcptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_hamdist", "extern void __gmpz_fib_ui(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_fib_ui", "extern int __gmpz_cmp_ui(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_cmp_ui", "extern mp_limb_t __gmpn_submul_1(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, mp_limb_t arg3) [free function]" : "__gmpn_submul_1", "extern void __gmpf_init2(mpf_ptr arg0, long unsigned int arg1) [free function]" : "__gmpf_init2", - "extern int __gmpz_cmpabs(mpz_srcptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_cmpabs", - "extern long unsigned int __gmpz_tdiv_q_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_tdiv_q_ui", + "extern mp_limb_t __gmpn_mul_1(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, mp_limb_t arg3) [free function]" : "__gmpn_mul_1", "extern mp_limb_t __gmpn_mod_1(mp_srcptr arg0, mp_size_t arg1, mp_limb_t arg2) [free function]" : "__gmpn_mod_1", "size_t __gmpz_size(mpz_srcptr __gmp_z) [free function]" : "__gmpz_size", "extern void __gmpq_get_den(mpz_ptr arg0, mpq_srcptr arg1) [free function]" : "__gmpq_get_den", "extern mp_limb_t __gmpn_preinv_mod_1(mp_srcptr arg0, mp_size_t arg1, mp_limb_t arg2, mp_limb_t arg3) [free function]" : "__gmpn_preinv_mod_1", "extern long unsigned int __gmpz_tdiv_ui(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_tdiv_ui", - "int __gmpz_fits_uint_p(mpz_srcptr __gmp_z) [free function]" : "__gmpz_fits_uint_p", + "extern mp_limb_t __gmpn_gcd_1(mp_srcptr arg0, mp_size_t arg1, mp_limb_t arg2) [free function]" : "__gmpn_gcd_1", + "extern void __gmp_randinit(__gmp_randstate_struct * arg0, gmp_randalg_t arg1, ...) [free function]" : "__gmp_randinit", "extern void __gmpf_init(mpf_ptr arg0) [free function]" : "__gmpf_init", - "extern double __gmpf_get_d_2exp(long int * arg0, mpf_srcptr arg1) [free function]" : "__gmpf_get_d_2exp", "extern void __gmpz_mul(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_mul", - "extern void __gmpq_add(mpq_ptr arg0, mpq_srcptr arg1, mpq_srcptr arg2) [free function]" : "__gmpq_add", + "extern long unsigned int __gmpn_scan1(mp_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpn_scan1", "extern void __gmpq_set(mpq_ptr arg0, mpq_srcptr arg1) [free function]" : "__gmpq_set", - "extern long unsigned int __gmpn_scan0(mp_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpn_scan0", - "mp_limb_t __gmpn_sub(mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize) [free function]" : "__gmpn_sub", - "extern void __gmpz_fdiv_q_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_fdiv_q_2exp", - "extern void __gmpz_sqrtrem(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_sqrtrem", + "extern int __gmpz_fits_sint_p(mpz_srcptr arg0) [free function]" : "__gmpz_fits_sint_p", + "extern long unsigned int __gmpz_cdiv_qr_ui(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2, long unsigned int arg3) [free function]" : "__gmpz_cdiv_qr_ui", + "extern void __gmpz_clear(mpz_ptr arg0) [free function]" : "__gmpz_clear", + "extern mp_limb_t __gmpn_mul(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, mp_srcptr arg3, mp_size_t arg4) [free function]" : "__gmpn_mul", "extern void __gmpz_init_set_si(mpz_ptr arg0, long int arg1) [free function]" : "__gmpz_init_set_si", "extern int __gmpz_divisible_p(mpz_srcptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_divisible_p", "__gmp_errno [variable]" : "__gmp_errno", - "extern void __gmpf_pow_ui(mpf_ptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_pow_ui", + "extern void __gmpf_sub_ui(mpf_ptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_sub_ui", "extern void __gmpz_swap(mpz_ptr arg0, mpz_ptr arg1) [free function]" : "__gmpz_swap", "extern int __gmpz_cmp(mpz_srcptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_cmp", "extern void __gmpf_init_set_si(mpf_ptr arg0, long int arg1) [free function]" : "__gmpf_init_set_si", - "extern long unsigned int __gmpz_tdiv_r_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_tdiv_r_ui", + "extern mp_limb_t __gmpn_lshift(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, unsigned int arg3) [free function]" : "__gmpn_lshift", "extern int __gmpq_cmp_si(mpq_srcptr arg0, long int arg1, long unsigned int arg2) [free function]" : "__gmpq_cmp_si", + "void __gmpz_abs(mpz_ptr __gmp_w, mpz_srcptr __gmp_u) [free function]" : "__gmpz_abs", "extern int __gmp_fprintf(FILE * arg0, char const * arg1, ...) [free function]" : "__gmp_fprintf", - "extern int __gmpf_fits_sint_p(mpf_srcptr arg0) [free function]" : "__gmpf_fits_sint_p", + "extern void __gmpf_set(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_set", + "extern int __gmpz_divisible_ui_p(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_divisible_ui_p", "extern int __gmpf_cmp_d(mpf_srcptr arg0, double arg1) [free function]" : "__gmpf_cmp_d", "extern char * __gmpf_get_str(char * arg0, mp_exp_t * arg1, int arg2, size_t arg3, mpf_srcptr arg4) [free function]" : "__gmpf_get_str", "extern long unsigned int __gmpz_fdiv_q_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_fdiv_q_ui", @@ -175,47 +178,46 @@ "extern void __gmpz_urandomm(mpz_ptr arg0, __gmp_randstate_struct * arg1, mpz_srcptr arg2) [free function]" : "__gmpz_urandomm", "extern void __gmpq_mul(mpq_ptr arg0, mpq_srcptr arg1, mpq_srcptr arg2) [free function]" : "__gmpq_mul", "extern void __gmpz_tdiv_q(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_tdiv_q", - "extern void __gmpf_sub(mpf_ptr arg0, mpf_srcptr arg1, mpf_srcptr arg2) [free function]" : "__gmpf_sub", - "extern void __gmpz_set_ui(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_set_ui", - "extern void __gmpz_random(mpz_ptr arg0, mp_size_t arg1) [free function]" : "__gmpz_random", + "extern int __gmpf_fits_uint_p(mpf_srcptr arg0) [free function]" : "__gmpf_fits_uint_p", + "extern void * __gmpz_realloc(mpz_ptr arg0, mp_size_t arg1) [free function]" : "__gmpz_realloc", "extern long unsigned int __gmp_urandomb_ui(__gmp_randstate_struct * arg0, long unsigned int arg1) [free function]" : "__gmp_urandomb_ui", - "extern void __gmpf_floor(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_floor", + "extern int __gmpz_perfect_power_p(mpz_srcptr arg0) [free function]" : "__gmpz_perfect_power_p", "extern char * __gmpq_get_str(char * arg0, int arg1, mpq_srcptr arg2) [free function]" : "__gmpq_get_str", "extern int __gmpn_perfect_square_p(mp_srcptr arg0, mp_size_t arg1) [free function]" : "__gmpn_perfect_square_p", "extern void __gmpz_addmul(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_addmul", - "extern int __gmpq_cmp(mpq_srcptr arg0, mpq_srcptr arg1) [free function]" : "__gmpq_cmp", + "extern long unsigned int __gmpz_fdiv_ui(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_fdiv_ui", + "extern int __gmp_sprintf(char * arg0, char const * arg1, ...) [free function]" : "__gmp_sprintf", "extern void __gmpz_bin_uiui(mpz_ptr arg0, long unsigned int arg1, long unsigned int arg2) [free function]" : "__gmpz_bin_uiui", "void __gmpz_set_q(mpz_ptr __gmp_w, mpq_srcptr __gmp_u) [free function]" : "__gmpz_set_q", - "extern int __gmpz_congruent_ui_p(mpz_srcptr arg0, long unsigned int arg1, long unsigned int arg2) [free function]" : "__gmpz_congruent_ui_p", + "mp_limb_t __gmpn_neg_n(mp_ptr __gmp_rp, mp_srcptr __gmp_up, mp_size_t __gmp_n) [free function]" : "__gmpn_neg_n", "extern void __gmpf_neg(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_neg", "extern void __gmp_randseed(__gmp_randstate_struct * arg0, mpz_srcptr arg1) [free function]" : "__gmp_randseed", - "extern void __gmpz_mul_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_mul_ui", - "extern void __gmpz_init2(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_init2", + "extern long unsigned int __gmpz_scan1(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_scan1", "extern void __gmpz_nextprime(mpz_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_nextprime", - "extern void __gmpz_set_d(mpz_ptr arg0, double arg1) [free function]" : "__gmpz_set_d", - "extern size_t __gmpz_inp_raw(mpz_ptr arg0, FILE * arg1) [free function]" : "__gmpz_inp_raw", - "extern void __gmpz_rrandomb(mpz_ptr arg0, __gmp_randstate_struct * arg1, long unsigned int arg2) [free function]" : "__gmpz_rrandomb", + "extern int __gmpz_si_kronecker(long int arg0, mpz_srcptr arg1) [free function]" : "__gmpz_si_kronecker", + "extern int __gmpz_congruent_ui_p(mpz_srcptr arg0, long unsigned int arg1, long unsigned int arg2) [free function]" : "__gmpz_congruent_ui_p", "extern long unsigned int __gmpz_cdiv_ui(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_cdiv_ui", - "extern int __gmpz_si_kronecker(long int arg0, mpz_srcptr arg1) [free function]" : "__gmpz_si_kronecker", - "extern mp_limb_t __gmpn_divrem_2(mp_ptr arg0, mp_size_t arg1, mp_ptr arg2, mp_size_t arg3, mp_srcptr arg4) [free function]" : "__gmpn_divrem_2", - "extern void __gmp_randseed_ui(__gmp_randstate_struct * arg0, long unsigned int arg1) [free function]" : "__gmp_randseed_ui", + "extern void __gmpz_init_set_ui(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_init_set_ui", + "extern mp_limb_t __gmpn_sub_n(mp_ptr arg0, mp_srcptr arg1, mp_srcptr arg2, mp_size_t arg3) [free function]" : "__gmpn_sub_n", + "extern void __gmpq_set_num(mpq_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpq_set_num", "extern int __gmpz_kronecker_ui(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_kronecker_ui", "extern void __gmpf_add_ui(mpf_ptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_add_ui", "extern void __gmpz_gcdext(mpz_ptr arg0, mpz_ptr arg1, mpz_ptr arg2, mpz_srcptr arg3, mpz_srcptr arg4) [free function]" : "__gmpz_gcdext", - "extern void __gmpz_tdiv_q_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_tdiv_q_2exp", + "extern void __gmpq_get_num(mpz_ptr arg0, mpq_srcptr arg1) [free function]" : "__gmpq_get_num", "extern size_t __gmpf_size(mpf_srcptr arg0) [free function]" : "__gmpf_size", - "extern void __gmpf_swap(mpf_ptr arg0, mpf_ptr arg1) [free function]" : "__gmpf_swap", + "extern void __gmpq_inv(mpq_ptr arg0, mpq_srcptr arg1) [free function]" : "__gmpq_inv", "extern mp_limb_t __gmpn_divrem_1(mp_ptr arg0, mp_size_t arg1, mp_srcptr arg2, mp_size_t arg3, mp_limb_t arg4) [free function]" : "__gmpn_divrem_1", "extern void __gmpq_canonicalize(mpq_ptr arg0) [free function]" : "__gmpq_canonicalize", "long unsigned int __gmpz_popcount(mpz_srcptr __gmp_u) [free function]" : "__gmpz_popcount", "extern void __gmpf_ui_sub(mpf_ptr arg0, long unsigned int arg1, mpf_srcptr arg2) [free function]" : "__gmpf_ui_sub", "extern int __gmpz_cmp_si(mpz_srcptr arg0, long int arg1) [free function]" : "__gmpz_cmp_si", "extern int __gmpz_set_str(mpz_ptr arg0, char const * arg1, int arg2) [free function]" : "__gmpz_set_str", - "extern void __gmpz_realloc2(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_realloc2", + "extern int __gmpz_tstbit(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_tstbit", "extern void __gmpz_set_si(mpz_ptr arg0, long int arg1) [free function]" : "__gmpz_set_si", - "int __gmpn_cmp(mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) [free function]" : "__gmpn_cmp", + "extern void __gmpq_init(mpq_ptr arg0) [free function]" : "__gmpq_init", "extern size_t __gmpz_out_raw(FILE * arg0, mpz_srcptr arg1) [free function]" : "__gmpz_out_raw", - "extern int __gmp_sscanf(char const * arg0, char const * arg1, ...) [free function]" : "__gmp_sscanf", + "extern void __gmpf_trunc(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_trunc", + "extern mp_limb_t __gmpn_gcdext_1(mp_ptr arg0, mp_ptr arg1, mp_limb_t arg2, mp_limb_t arg3) [free function]" : "__gmpn_gcdext_1", "extern int __gmpz_cmpabs_d(mpz_srcptr arg0, double arg1) [free function]" : "__gmpz_cmpabs_d", "extern void * __gmpz_export(void * arg0, size_t * arg1, int arg2, size_t arg3, int arg4, size_t arg5, mpz_srcptr arg6) [free function]" : "__gmpz_export", "extern double __gmpz_get_d_2exp(long int * arg0, mpz_srcptr arg1) [free function]" : "__gmpz_get_d_2exp", @@ -225,86 +227,86 @@ "extern size_t __gmpz_sizeinbase(mpz_srcptr arg0, int arg1) [free function]" : "__gmpz_sizeinbase", "extern long unsigned int __gmpz_fdiv_r_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_fdiv_r_ui", "extern void __gmp_randinit_default(__gmp_randstate_struct * arg0) [free function]" : "__gmp_randinit_default", + "mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z, mp_size_t __gmp_n) [free function]" : "__gmpz_getlimbn", "extern long int __gmpf_get_si(mpf_srcptr arg0) [free function]" : "__gmpf_get_si", "extern void __gmpz_init(mpz_ptr arg0) [free function]" : "__gmpz_init", "extern void __gmpf_div_2exp(mpf_ptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_div_2exp", "extern void __gmpf_set_si(mpf_ptr arg0, long int arg1) [free function]" : "__gmpf_set_si", "extern int __gmpq_equal(mpq_srcptr arg0, mpq_srcptr arg1) [free function]" : "__gmpq_equal", - "extern void __gmpq_set_num(mpq_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpq_set_num", - "extern void * __gmpz_realloc(mpz_ptr arg0, mp_size_t arg1) [free function]" : "__gmpz_realloc", + "extern void __gmpz_rrandomb(mpz_ptr arg0, __gmp_randstate_struct * arg1, long unsigned int arg2) [free function]" : "__gmpz_rrandomb", + "extern int __gmpf_cmp_si(mpf_srcptr arg0, long int arg1) [free function]" : "__gmpf_cmp_si", "extern long unsigned int __gmpz_scan0(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_scan0", - "extern long unsigned int __gmpz_scan1(mpz_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpz_scan1", + "extern void __gmpz_init2(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_init2", "extern void __gmpz_random2(mpz_ptr arg0, mp_size_t arg1) [free function]" : "__gmpz_random2", "extern mp_size_t __gmpn_pow_1(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, mp_limb_t arg3, mp_ptr arg4) [free function]" : "__gmpn_pow_1", + "extern void __gmpz_gcd(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_gcd", "extern void __gmpf_mul_2exp(mpf_ptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_mul_2exp", - "extern long unsigned int __gmpn_scan1(mp_srcptr arg0, long unsigned int arg1) [free function]" : "__gmpn_scan1", - "extern int __gmpz_fits_slong_p(mpz_srcptr arg0) [free function]" : "__gmpz_fits_slong_p", + "extern double __gmpq_get_d(mpq_srcptr arg0) [free function]" : "__gmpq_get_d", "extern void __gmpf_mul(mpf_ptr arg0, mpf_srcptr arg1, mpf_srcptr arg2) [free function]" : "__gmpf_mul", "extern void __gmpf_div_ui(mpf_ptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_div_ui", - "extern long unsigned int __gmpn_popcount(mp_srcptr arg0, mp_size_t arg1) [free function]" : "__gmpn_popcount", - "extern int __gmpz_fits_sshort_p(mpz_srcptr arg0) [free function]" : "__gmpz_fits_sshort_p", - "extern mp_limb_t __gmpn_sub_n(mp_ptr arg0, mp_srcptr arg1, mp_srcptr arg2, mp_size_t arg3) [free function]" : "__gmpn_sub_n", - "mp_limb_t __gmpz_getlimbn(mpz_srcptr __gmp_z, mp_size_t __gmp_n) [free function]" : "__gmpz_getlimbn", "extern void __gmpq_mul_2exp(mpq_ptr arg0, mpq_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpq_mul_2exp", + "extern size_t __gmpz_out_str(FILE * arg0, int arg1, mpz_srcptr arg2) [free function]" : "__gmpz_out_str", + "extern mp_limb_t __gmpn_divrem_2(mp_ptr arg0, mp_size_t arg1, mp_ptr arg2, mp_size_t arg3, mp_srcptr arg4) [free function]" : "__gmpn_divrem_2", + "extern int __gmpz_cmpabs(mpz_srcptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_cmpabs", + "extern void __gmpz_powm_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2, mpz_srcptr arg3) [free function]" : "__gmpz_powm_ui", "extern size_t __gmpq_out_str(FILE * arg0, int arg1, mpq_srcptr arg2) [free function]" : "__gmpq_out_str", "void __gmpz_neg(mpz_ptr __gmp_w, mpz_srcptr __gmp_u) [free function]" : "__gmpz_neg", + "extern void __gmpf_swap(mpf_ptr arg0, mpf_ptr arg1) [free function]" : "__gmpf_swap", + "extern void __gmp_randseed_ui(__gmp_randstate_struct * arg0, long unsigned int arg1) [free function]" : "__gmp_randseed_ui", + "extern void __gmpz_sqrtrem(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_sqrtrem", "extern long unsigned int __gmpz_tdiv_qr_ui(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2, long unsigned int arg3) [free function]" : "__gmpz_tdiv_qr_ui", "extern mp_limb_t __gmpn_bdivmod(mp_ptr arg0, mp_ptr arg1, mp_size_t arg2, mp_srcptr arg3, mp_size_t arg4, long unsigned int arg5) [free function]" : "__gmpn_bdivmod", - "extern void __gmpz_powm_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2, mpz_srcptr arg3) [free function]" : "__gmpz_powm_ui", + "extern void __gmpn_random(mp_ptr arg0, mp_size_t arg1) [free function]" : "__gmpn_random", "extern void __gmpq_set_z(mpq_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpq_set_z", - "extern void __gmpz_set(mpz_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_set", - "extern void __gmpz_tdiv_r_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_tdiv_r_2exp", + "extern void __gmpz_cdiv_q(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_cdiv_q", "extern long int __gmpz_get_si(mpz_srcptr arg0) [free function]" : "__gmpz_get_si", "extern void __gmpf_init_set(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_init_set", "extern void __gmpf_init_set_d(mpf_ptr arg0, double arg1) [free function]" : "__gmpf_init_set_d", - "extern void __gmpf_reldiff(mpf_ptr arg0, mpf_srcptr arg1, mpf_srcptr arg2) [free function]" : "__gmpf_reldiff", - "extern long unsigned int __gmpz_cdiv_r_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_cdiv_r_ui", - "extern void __gmpz_sqrt(mpz_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_sqrt", - "extern long unsigned int __gmpf_get_ui(mpf_srcptr arg0) [free function]" : "__gmpf_get_ui", + "extern int __gmpf_cmp(mpf_srcptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_cmp", + "extern int __gmpf_eq(mpf_srcptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_eq", + "extern long unsigned int __gmpn_popcount(mp_srcptr arg0, mp_size_t arg1) [free function]" : "__gmpn_popcount", + "extern void __gmpf_ceil(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_ceil", "mp_limb_t __gmpn_add_1(mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) [free function]" : "__gmpn_add_1", - "extern void __gmp_set_memory_functions(void * (*)( ::size_t ) * arg0, void * (*)( void *,::size_t,::size_t ) * arg1, void (*)( void *,::size_t ) * arg2) [free function]" : "__gmp_set_memory_functions", "extern void __gmpz_fib2_ui(mpz_ptr arg0, mpz_ptr arg1, long unsigned int arg2) [free function]" : "__gmpz_fib2_ui", "extern int __gmp_printf(char const * arg0, ...) [free function]" : "__gmp_printf", - "extern void __gmpz_sub(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_sub", + "extern void __gmpq_set_f(mpq_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpq_set_f", "extern void __gmpf_clear(mpf_ptr arg0) [free function]" : "__gmpf_clear", "extern size_t __gmpn_get_str(unsigned char * arg0, int arg1, mp_ptr arg2, mp_size_t arg3) [free function]" : "__gmpn_get_str", "extern int __gmp_fscanf(FILE * arg0, char const * arg1, ...) [free function]" : "__gmp_fscanf", + "extern int __gmpz_ui_kronecker(long unsigned int arg0, mpz_srcptr arg1) [free function]" : "__gmpz_ui_kronecker", "mp_limb_t __gmpn_add(mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize) [free function]" : "__gmpn_add", - "extern long unsigned int __gmpz_cdiv_qr_ui(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2, long unsigned int arg3) [free function]" : "__gmpz_cdiv_qr_ui", + "mp_limb_t __gmpn_sub(mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize) [free function]" : "__gmpn_sub", "extern void __gmpz_bin_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_bin_ui", - "extern mp_size_t __gmpn_gcd(mp_ptr arg0, mp_ptr arg1, mp_size_t arg2, mp_ptr arg3, mp_size_t arg4) [free function]" : "__gmpn_gcd", - "extern void __gmpz_clear(mpz_ptr arg0) [free function]" : "__gmpz_clear", + "extern void __gmpz_fdiv_q_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_fdiv_q_2exp", "extern void __gmpf_dump(mpf_srcptr arg0) [free function]" : "__gmpf_dump", - "extern void __gmp_randinit_mt(__gmp_randstate_struct * arg0) [free function]" : "__gmp_randinit_mt", + "extern void __gmpz_tdiv_r_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_tdiv_r_2exp", "extern void __gmpz_submul_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_submul_ui", - "extern mp_limb_t __gmpn_divexact_by3c(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, mp_limb_t arg3) [free function]" : "__gmpn_divexact_by3c", + "extern long unsigned int __gmpz_cdiv_q_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_cdiv_q_ui", "extern void __gmpz_dump(mpz_srcptr arg0) [free function]" : "__gmpz_dump", - "extern int __gmpz_jacobi(mpz_srcptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_jacobi", + "extern void __gmp_randclear(__gmp_randstate_struct * arg0) [free function]" : "__gmp_randclear", "__gmp_version [variable]" : "__gmp_version", - "extern int __gmpf_integer_p(mpf_srcptr arg0) [free function]" : "__gmpf_integer_p", + "extern long unsigned int __gmpz_remove(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_remove", "extern void __gmpf_set_default_prec(long unsigned int arg0) [free function]" : "__gmpf_set_default_prec", "extern int __gmpz_congruent_p(mpz_srcptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]" : "__gmpz_congruent_p", - "extern void __gmpn_random(mp_ptr arg0, mp_size_t arg1) [free function]" : "__gmpn_random", - "extern void __gmpf_sub_ui(mpf_ptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_sub_ui", + "extern void __gmpf_pow_ui(mpf_ptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_pow_ui", "extern void __gmpz_lcm_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpz_lcm_ui", "extern void __gmpz_rootrem(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2, long unsigned int arg3) [free function]" : "__gmpz_rootrem", "extern void __gmpz_lucnum2_ui(mpz_ptr arg0, mpz_ptr arg1, long unsigned int arg2) [free function]" : "__gmpz_lucnum2_ui", - "extern void __gmpf_set(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_set", + "extern void __gmpz_set_ui(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_set_ui", "void __gmpq_abs(mpq_ptr __gmp_w, mpq_srcptr __gmp_u) [free function]" : "__gmpq_abs", "extern long unsigned int __gmpn_hamdist(mp_srcptr arg0, mp_srcptr arg1, mp_size_t arg2) [free function]" : "__gmpn_hamdist", "extern int __gmpf_fits_ushort_p(mpf_srcptr arg0) [free function]" : "__gmpf_fits_ushort_p", - "extern size_t __gmpz_out_str(FILE * arg0, int arg1, mpz_srcptr arg2) [free function]" : "__gmpz_out_str", + "extern void __gmpz_set(mpz_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpz_set", "extern void __gmpq_set_den(mpq_ptr arg0, mpz_srcptr arg1) [free function]" : "__gmpq_set_den", "extern void __gmpf_abs(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_abs", "extern void __gmp_get_memory_functions(void * (*)( ::size_t ) * * arg0, void * (*)( void *,::size_t,::size_t ) * * arg1, void (*)( void *,::size_t ) * * arg2) [free function]" : "__gmp_get_memory_functions", "extern void __gmpf_ui_div(mpf_ptr arg0, long unsigned int arg1, mpf_srcptr arg2) [free function]" : "__gmpf_ui_div", - "extern void __gmpq_get_num(mpz_ptr arg0, mpq_srcptr arg1) [free function]" : "__gmpq_get_num", + "extern mp_size_t __gmpn_gcd(mp_ptr arg0, mp_ptr arg1, mp_size_t arg2, mp_ptr arg3, mp_size_t arg4) [free function]" : "__gmpn_gcd", "extern mp_limb_t __gmpn_add_n(mp_ptr arg0, mp_srcptr arg1, mp_srcptr arg2, mp_size_t arg3) [free function]" : "__gmpn_add_n", - "extern mp_limb_t __gmpn_mul(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, mp_srcptr arg3, mp_size_t arg4) [free function]" : "__gmpn_mul", - "extern int __gmpz_perfect_power_p(mpz_srcptr arg0) [free function]" : "__gmpz_perfect_power_p", + "extern size_t __gmpz_inp_raw(mpz_ptr arg0, FILE * arg1) [free function]" : "__gmpz_inp_raw", "int __gmpz_fits_ulong_p(mpz_srcptr __gmp_z) [free function]" : "__gmpz_fits_ulong_p", "extern void __gmpq_clear(mpq_ptr arg0) [free function]" : "__gmpq_clear", - "extern void __gmpf_ceil(mpf_ptr arg0, mpf_srcptr arg1) [free function]" : "__gmpf_ceil", + "extern long unsigned int __gmpf_get_ui(mpf_srcptr arg0) [free function]" : "__gmpf_get_ui", "extern void __gmpz_fdiv_qr(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2, mpz_srcptr arg3) [free function]" : "__gmpz_fdiv_qr", "extern void __gmpf_mul_ui(mpf_ptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]" : "__gmpf_mul_ui", "extern void __gmpz_combit(mpz_ptr arg0, long unsigned int arg1) [free function]" : "__gmpz_combit", @@ -313,58 +315,61 @@ "extern int __gmpf_init_set_str(mpf_ptr arg0, char const * arg1, int arg2) [free function]" : "__gmpf_init_set_str", "__gmpf_get_d" : "extern double __gmpf_get_d(mpf_srcptr arg0) [free function]", "__gmpf_cmp_ui" : "extern int __gmpf_cmp_ui(mpf_srcptr arg0, long unsigned int arg1) [free function]", - "__gmpz_fac_ui" : "extern void __gmpz_fac_ui(mpz_ptr arg0, long unsigned int arg1) [free function]", + "__gmpz_mul_ui" : "extern void __gmpz_mul_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", "__gmpz_and" : "extern void __gmpz_and(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", "__gmpf_urandomb" : "extern void __gmpf_urandomb(__mpf_struct * arg0, __gmp_randstate_struct * arg1, long unsigned int arg2) [free function]", - "__gmpn_mul_1" : "extern mp_limb_t __gmpn_mul_1(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, mp_limb_t arg3) [free function]", - "__gmpz_mul_2exp" : "extern void __gmpz_mul_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", + "__gmpz_tdiv_q_ui" : "extern long unsigned int __gmpz_tdiv_q_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", "__gmpz_clrbit" : "extern void __gmpz_clrbit(mpz_ptr arg0, long unsigned int arg1) [free function]", "__gmpz_cdiv_r_2exp" : "extern void __gmpz_cdiv_r_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", "__gmpz_lcm" : "extern void __gmpz_lcm(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", - "__gmpz_gcd" : "extern void __gmpz_gcd(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", + "__gmpf_get_d_2exp" : "extern double __gmpf_get_d_2exp(long int * arg0, mpf_srcptr arg1) [free function]", "__gmpz_divisible_2exp_p" : "extern int __gmpz_divisible_2exp_p(mpz_srcptr arg0, long unsigned int arg1) [free function]", "__gmpz_congruent_2exp_p" : "extern int __gmpz_congruent_2exp_p(mpz_srcptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", "__gmpz_pow_ui" : "extern void __gmpz_pow_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", "__gmpq_neg" : "void __gmpq_neg(mpq_ptr __gmp_w, mpq_srcptr __gmp_u) [free function]", + "__gmpf_reldiff" : "extern void __gmpf_reldiff(mpf_ptr arg0, mpf_srcptr arg1, mpf_srcptr arg2) [free function]", "__gmpz_import" : "extern void __gmpz_import(mpz_ptr arg0, size_t arg1, int arg2, size_t arg3, int arg4, size_t arg5, void const * arg6) [free function]", - "__gmpz_fdiv_ui" : "extern long unsigned int __gmpz_fdiv_ui(mpz_srcptr arg0, long unsigned int arg1) [free function]", + "__gmpz_fac_ui" : "extern void __gmpz_fac_ui(mpz_ptr arg0, long unsigned int arg1) [free function]", "__gmpz_root" : "extern int __gmpz_root(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", "__gmpz_fdiv_q" : "extern void __gmpz_fdiv_q(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", "__gmpz_fdiv_r" : "extern void __gmpz_fdiv_r(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", - "__gmpq_inp_str" : "extern size_t __gmpq_inp_str(mpq_ptr arg0, FILE * arg1, int arg2) [free function]", - "__gmpz_ui_kronecker" : "extern int __gmpz_ui_kronecker(long unsigned int arg0, mpz_srcptr arg1) [free function]", - "__gmpz_remove" : "extern long unsigned int __gmpz_remove(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", - "__gmpz_tstbit" : "extern int __gmpz_tstbit(mpz_srcptr arg0, long unsigned int arg1) [free function]", + "__gmp_set_memory_functions" : "extern void __gmp_set_memory_functions(void * (*)( ::size_t ) * arg0, void * (*)( void *,::size_t,::size_t ) * arg1, void (*)( void *,::size_t ) * arg2) [free function]", + "__gmpz_tdiv_r_ui" : "extern long unsigned int __gmpz_tdiv_r_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", + "__gmpz_cdiv_r_ui" : "extern long unsigned int __gmpz_cdiv_r_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", + "__gmpz_realloc2" : "extern void __gmpz_realloc2(mpz_ptr arg0, long unsigned int arg1) [free function]", "__gmpn_tdiv_qr" : "extern void __gmpn_tdiv_qr(mp_ptr arg0, mp_ptr arg1, mp_size_t arg2, mp_srcptr arg3, mp_size_t arg4, mp_srcptr arg5, mp_size_t arg6) [free function]", "__gmpz_fdiv_r_2exp" : "extern void __gmpz_fdiv_r_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", - "__gmpf_div" : "extern void __gmpf_div(mpf_ptr arg0, mpf_srcptr arg1, mpf_srcptr arg2) [free function]", + "__gmpz_sqrt" : "extern void __gmpz_sqrt(mpz_ptr arg0, mpz_srcptr arg1) [free function]", + "__gmpq_add" : "extern void __gmpq_add(mpq_ptr arg0, mpq_srcptr arg1, mpq_srcptr arg2) [free function]", "__gmpq_div" : "extern void __gmpq_div(mpq_ptr arg0, mpq_srcptr arg1, mpq_srcptr arg2) [free function]", - "__gmpz_ui_pow_ui" : "extern void __gmpz_ui_pow_ui(mpz_ptr arg0, long unsigned int arg1, long unsigned int arg2) [free function]", + "__gmpf_get_default_prec" : "extern long unsigned int __gmpf_get_default_prec() [free function]", "__gmpq_sub" : "extern void __gmpq_sub(mpq_ptr arg0, mpq_srcptr arg1, mpq_srcptr arg2) [free function]", "__gmpf_set_ui" : "extern void __gmpf_set_ui(mpf_ptr arg0, long unsigned int arg1) [free function]", - "__gmpn_lshift" : "extern mp_limb_t __gmpn_lshift(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, unsigned int arg3) [free function]", + "__gmpz_get_d" : "extern double __gmpz_get_d(mpz_srcptr arg0) [free function]", "__gmpz_add" : "extern void __gmpz_add(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", - "__gmpf_trunc" : "extern void __gmpf_trunc(mpf_ptr arg0, mpf_srcptr arg1) [free function]", + "__gmpn_cmp" : "int __gmpn_cmp(mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) [free function]", "__gmpz_divexact_ui" : "extern void __gmpz_divexact_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", "__gmpz_gcd_ui" : "extern long unsigned int __gmpz_gcd_ui(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", - "__gmpz_cdiv_r" : "extern void __gmpz_cdiv_r(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", "__gmpz_inp_str" : "extern size_t __gmpz_inp_str(mpz_ptr arg0, FILE * arg1, int arg2) [free function]", - "__gmpq_get_d" : "extern double __gmpq_get_d(mpq_srcptr arg0) [free function]", - "__gmp_sprintf" : "extern int __gmp_sprintf(char * arg0, char const * arg1, ...) [free function]", - "__gmpn_random2" : "extern void __gmpn_random2(mp_ptr arg0, mp_size_t arg1) [free function]", + "__gmp_snprintf" : "extern int __gmp_snprintf(char * arg0, size_t arg1, char const * arg2, ...) [free function]", + "__gmpf_set_prec_raw" : "extern void __gmpf_set_prec_raw(mpf_ptr arg0, long unsigned int arg1) [free function]", "__gmpz_cdiv_q_2exp" : "extern void __gmpz_cdiv_q_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", - "__gmpf_eq" : "extern int __gmpf_eq(mpf_srcptr arg0, mpf_srcptr arg1, long unsigned int arg2) [free function]", + "__gmpz_fits_sshort_p" : "extern int __gmpz_fits_sshort_p(mpz_srcptr arg0) [free function]", "__gmpn_divrem" : "extern mp_limb_t __gmpn_divrem(mp_ptr arg0, mp_size_t arg1, mp_ptr arg2, mp_size_t arg3, mp_srcptr arg4, mp_size_t arg5) [free function]", - "__gmpz_cdiv_q" : "extern void __gmpz_cdiv_q(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", - "__gmpz_abs" : "void __gmpz_abs(mpz_ptr __gmp_w, mpz_srcptr __gmp_u) [free function]", + "__gmpz_submul" : "extern void __gmpz_submul(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", + "__gmpz_init_set" : "extern void __gmpz_init_set(mpz_ptr arg0, mpz_srcptr arg1) [free function]", "__gmpz_xor" : "extern void __gmpz_xor(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", "__gmpz_init_set_d" : "extern void __gmpz_init_set_d(mpz_ptr arg0, double arg1) [free function]", "__gmpz_fits_ushort_p" : "int __gmpz_fits_ushort_p(mpz_srcptr __gmp_z) [free function]", - "__gmpq_set_f" : "extern void __gmpq_set_f(mpq_ptr arg0, mpf_srcptr arg1) [free function]", + "__gmp_sscanf" : "extern int __gmp_sscanf(char const * arg0, char const * arg1, ...) [free function]", + "__gmpz_mul_2exp" : "extern void __gmpz_mul_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", + "__gmpz_sub" : "extern void __gmpz_sub(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", "__gmpf_fits_ulong_p" : "extern int __gmpf_fits_ulong_p(mpf_srcptr arg0) [free function]", + "__gmpz_ui_pow_ui" : "extern void __gmpz_ui_pow_ui(mpz_ptr arg0, long unsigned int arg1, long unsigned int arg2) [free function]", + "__gmp_urandomm_ui" : "extern long unsigned int __gmp_urandomm_ui(__gmp_randstate_struct * arg0, long unsigned int arg1) [free function]", "__gmpz_get_ui" : "long unsigned int __gmpz_get_ui(mpz_srcptr __gmp_z) [free function]", "__gmpz_cmpabs_ui" : "extern int __gmpz_cmpabs_ui(mpz_srcptr arg0, long unsigned int arg1) [free function]", - "__gmp_urandomm_ui" : "extern long unsigned int __gmp_urandomm_ui(__gmp_randstate_struct * arg0, long unsigned int arg1) [free function]", + "__gmpz_tdiv_q_2exp" : "extern void __gmpz_tdiv_q_2exp(mpz_ptr arg0, mpz_srcptr arg1, long unsigned int arg2) [free function]", "__gmpz_perfect_square_p" : "int __gmpz_perfect_square_p(mpz_srcptr __gmp_a) [free function]", "__gmpq_set_d" : "extern void __gmpq_set_d(mpq_ptr arg0, double arg1) [free function]", "__gmpz_cmp_d" : "extern int __gmpz_cmp_d(mpz_srcptr arg0, double arg1) [free function]", @@ -373,13 +378,13 @@ "__gmpz_probab_prime_p" : "extern int __gmpz_probab_prime_p(mpz_srcptr arg0, int arg1) [free function]", "__gmpn_rshift" : "extern mp_limb_t __gmpn_rshift(mp_ptr arg0, mp_srcptr arg1, mp_size_t arg2, unsigned int arg3) [free function]", "__gmpz_array_init" : "extern void __gmpz_array_init(mpz_ptr arg0, mp_size_t arg1, mp_size_t arg2) [free function]", - "__gmpf_get_default_prec" : "extern long unsigned int __gmpf_get_default_prec() [free function]", + "__gmpz_fits_uint_p" : "int __gmpz_fits_uint_p(mpz_srcptr __gmp_z) [free function]", "__gmpf_random2" : "extern void __gmpf_random2(mpf_ptr arg0, mp_size_t arg1, mp_exp_t arg2) [free function]", "__gmp_randinit_set" : "extern void __gmp_randinit_set(__gmp_randstate_struct * arg0, __gmp_randstate_struct const * arg1) [free function]", - "__gmpq_inv" : "extern void __gmpq_inv(mpq_ptr arg0, mpq_srcptr arg1) [free function]", + "__gmpz_tdiv_qr" : "extern void __gmpz_tdiv_qr(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2, mpz_srcptr arg3) [free function]", "__gmpn_set_str" : "extern mp_size_t __gmpn_set_str(mp_ptr arg0, unsigned char const * arg1, size_t arg2, int arg3) [free function]", - "__gmp_randinit" : "extern void __gmp_randinit(__gmp_randstate_struct * arg0, gmp_randalg_t arg1, ...) [free function]", - "__gmpn_sqrtrem" : "extern mp_size_t __gmpn_sqrtrem(mp_ptr arg0, mp_ptr arg1, mp_srcptr arg2, mp_size_t arg3) [free function]", + "__gmpn_scan0" : "extern long unsigned int __gmpn_scan0(mp_srcptr arg0, long unsigned int arg1) [free function]", + "__gmpz_cdiv_r" : "extern void __gmpz_cdiv_r(mpz_ptr arg0, mpz_srcptr arg1, mpz_srcptr arg2) [free function]", "__gmpz_fdiv_qr_ui" : "extern long unsigned int __gmpz_fdiv_qr_ui(mpz_ptr arg0, mpz_ptr arg1, mpz_srcptr arg2, long unsigned int arg3) [free function]", "__gmpf_init_set_ui" : "extern void __gmpf_init_set_ui(mpf_ptr arg0, long unsigned int arg1) [free function]", "__gmpn_mul_n" : "extern void __gmpn_mul_n(mp_ptr arg0, mp_srcptr arg1, mp_srcptr arg2, mp_size_t arg3) [free function]", @@ -388,88 +393,88 @@ "__gmpq_set_si" : "extern void __gmpq_set_si(mpq_ptr arg0, long int arg1, long unsigned int arg2) [free function]", "__gmpq_set_ui" : "extern void __gmpq_set_ui(mpq_ptr arg0, long unsigned int arg1, long unsigned int arg2) [free function]", "__gmpf_sqrt_ui" : "extern void __gmpf_sqrt_ui(mpf_ptr arg0, long unsigned int arg1) [free function]", - "__gmpz_init_set_ui" : "extern void __gmpz_init_set_ui(mpz_ptr arg0, long unsigned int arg1) [free function]", - "__gmpz_divisible_ui_p" : "extern int __gmpz_divisible_ui_p(mpz_srcptr arg0, long unsigned int arg1) [free function]", + "__gmpq_inp_str" : "extern size_t __gmpq_inp_str(mpq_ptr arg0, FILE * arg1, i... [truncated message content] |
From: <rom...@us...> - 2009-12-27 21:15:50
|
Revision: 1790 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1790&view=rev Author: roman_yakovenko Date: 2009-12-27 21:15:38 +0000 (Sun, 27 Dec 2009) Log Message: ----------- move "treat_char_ptr_as_binary_data" to public interface Modified Paths: -------------- pyplusplus_dev/pyplusplus/module_builder/ctypes_builder.py pyplusplus_dev/unittests/ctypes_tester.py Modified: pyplusplus_dev/pyplusplus/module_builder/ctypes_builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/ctypes_builder.py 2009-12-27 21:00:38 UTC (rev 1789) +++ pyplusplus_dev/pyplusplus/module_builder/ctypes_builder.py 2009-12-27 21:15:38 UTC (rev 1790) @@ -47,6 +47,8 @@ if optimize_queries: self.run_query_optimizer() + self.__treat_char_ptr_as_binary_data = None + def __parse_declarations( self, files, gccxml_config, compilation_mode=None, cache=None ): if None is gccxml_config: gccxml_config = parser.config_t() @@ -79,12 +81,27 @@ anonymous_vars = self.global_ns.vars( '', recursive=True, allow_empty=True ) anonymous_vars.alias = '_' + def __get_treat_char_ptr_as_binary_data(self): + if self.has_code_creator(): + return self.code_creator.treat_char_ptr_as_binary_data + else: + return self.__treat_char_ptr_as_binary_data + def __set_treat_char_ptr_as_binary_data( self, value ): + self.__treat_char_ptr_as_binary_data = value + if self.has_code_creator(): + self.code_creator.treat_char_ptr_as_binary_data = value + + treat_char_ptr_as_binary_data = property( __get_treat_char_ptr_as_binary_data, __set_treat_char_ptr_as_binary_data, + doc="""If True, Py++ will generate "POINTER( char )", instead of "c_char_p" for "char*" type. By default it is False""" ) + def build_code_creator( self, library_path, doc_extractor=None ): creator = creators_factory.ctypes_creator_t( self.global_ns , library_path , self.__blob2decl ) self.__code_creator = creator.create() self.__code_creator.update_documentation( doc_extractor ) + if self.__treat_char_ptr_as_binary_data != None: + self.__code_creator.treat_char_ptr_as_binary_data = self.__treat_char_ptr_as_binary_data return self.__code_creator @property Modified: pyplusplus_dev/unittests/ctypes_tester.py =================================================================== --- pyplusplus_dev/unittests/ctypes_tester.py 2009-12-27 21:00:38 UTC (rev 1789) +++ pyplusplus_dev/unittests/ctypes_tester.py 2009-12-27 21:15:38 UTC (rev 1790) @@ -49,9 +49,6 @@ def customize(self, mb ): pass - def customize_cc( self, mb ): - pass - def __build_scons_cmd( self ): cmd = autoconfig.scons.cmd_build + ' ' + self.base_name if autoconfig.cxx_parsers_cfg.gccxml.compiler == 'msvc71': @@ -71,7 +68,6 @@ mb = ctypes_module_builder_t( [self.header], self.symbols_file, autoconfig.cxx_parsers_cfg.gccxml ) self.customize( mb ) mb.build_code_creator( self.library_file ) - self.customize_cc( mb ) mb.write_module( os.path.join( self.project_dir, 'binaries', self.base_name + '.py' ) ) sys.path.insert( 0, os.path.join( self.project_dir, 'binaries' ) ) __import__( self.base_name ) @@ -221,8 +217,8 @@ def __init__( self, *args, **keywd ): ctypes_base_tester_t.__init__( self, 'char_ptr_as_binary_data', *args, **keywd ) - def customize_cc( self, mb ): - mb.code_creator.treat_char_ptr_as_binary_data = True + def customize( self, mb ): + mb.treat_char_ptr_as_binary_data = True def test(self): data = self.module_ref.get_empty() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2009-12-27 21:00:47
|
Revision: 1789 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1789&view=rev Author: roman_yakovenko Date: 2009-12-27 21:00:38 +0000 (Sun, 27 Dec 2009) Log Message: ----------- add ignore "binaries" directory Property Changed: ---------------- pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/ Property changes on: pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable ___________________________________________________________________ Added: svn:ignore + binaries This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2009-12-27 20:59:04
|
Revision: 1788 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1788&view=rev Author: roman_yakovenko Date: 2009-12-27 20:58:55 +0000 (Sun, 27 Dec 2009) Log Message: ----------- delete binary data Removed Paths: ------------- pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2009-12-27 20:45:28
|
Revision: 1787 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1787&view=rev Author: roman_yakovenko Date: 2009-12-27 20:45:19 +0000 (Sun, 27 Dec 2009) Log Message: ----------- remove binary data from svn Property Changed: ---------------- pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/ Property changes on: pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data ___________________________________________________________________ Added: svn:ignore + binaries This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2009-12-27 20:43:42
|
Revision: 1786 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1786&view=rev Author: roman_yakovenko Date: 2009-12-27 20:43:34 +0000 (Sun, 27 Dec 2009) Log Message: ----------- add ability to treat char* as a pointer to a binary data Modified Paths: -------------- pyplusplus_dev/pyplusplus/code_creators/calldef_ctypes.py pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py pyplusplus_dev/pyplusplus/code_creators/global_variable.py pyplusplus_dev/pyplusplus/code_creators/member_variable.py pyplusplus_dev/pyplusplus/code_creators/module.py pyplusplus_dev/pyplusplus/code_creators/typedef_as_pyvar.py pyplusplus_dev/unittests/ctypes_tester.py pyplusplus_dev/unittests/sconstruct Added Paths: ----------- pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/ pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/char_ptr_as_binary_data.cpp pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/char_ptr_as_binary_data.h pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/sconscript Removed Paths: ------------- pyplusplus_dev/pyplusplus/code_creators/ctypes_module.py Modified: pyplusplus_dev/pyplusplus/code_creators/calldef_ctypes.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/calldef_ctypes.py 2009-12-26 20:13:12 UTC (rev 1785) +++ pyplusplus_dev/pyplusplus/code_creators/calldef_ctypes.py 2009-12-27 20:43:34 UTC (rev 1786) @@ -66,14 +66,15 @@ def restype_code(self): if not declarations.is_void( self.ftype.return_type ): - return ctypes_formatter.as_ctype( self.ftype.return_type ) + return ctypes_formatter.as_ctype( self.ftype.return_type, self.top_parent.treat_char_ptr_as_binary_data ) else: return '' def argtypes_code(self, group_in_list=True): if not self.ftype.arguments_types: return '' - args = map( ctypes_formatter.as_ctype, self.ftype.arguments_types ) + args = map( lambda type_: ctypes_formatter.as_ctype( type_, self.top_parent.treat_char_ptr_as_binary_data ) + , self.ftype.arguments_types ) return self.join_arguments( args, group_in_list ) def _get_system_files_impl( self ): Modified: pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py 2009-12-26 20:13:12 UTC (rev 1785) +++ pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py 2009-12-27 20:43:34 UTC (rev 1786) @@ -16,11 +16,15 @@ All functions within this class should be redefined in derived classes. """ - def __init__(self, type_, decl_formatter): + def __init__(self, type_, treat_char_ptr_as_binary_data, decl_formatter=algorithm.complete_py_name): declarations.type_visitor_t.__init__(self) self.user_type = type_ self.decl_formatter = decl_formatter + self.treat_char_ptr_as_binary_data = treat_char_ptr_as_binary_data + def create_converter( self, type_): + return type_converter_t( type_, self.treat_char_ptr_as_binary_data, self.decl_formatter ) + def visit_void( self ): return "None" @@ -75,23 +79,23 @@ #skip complex and jxxx types def visit_volatile( self ): - base_visitor = type_converter_t( self.user_type.base, self.decl_formatter ) + base_visitor = self.create_converter( self.user_type.base ) return declarations.apply_visitor( base_visitor, base_visitor.user_type ) def visit_const( self ): - base_visitor = type_converter_t( self.user_type.base, self.decl_formatter ) + base_visitor = self.create_converter( self.user_type.base ) return declarations.apply_visitor( base_visitor, base_visitor.user_type ) def visit_pointer( self ): no_ptr = declarations.remove_const( declarations.remove_pointer( self.user_type ) ) - if declarations.is_same( declarations.char_t(), no_ptr ): + if declarations.is_same( declarations.char_t(), no_ptr ) and self.treat_char_ptr_as_binary_data == False: return "ctypes.c_char_p" - elif declarations.is_same( declarations.wchar_t(), no_ptr ): + elif declarations.is_same( declarations.wchar_t(), no_ptr ) and self.treat_char_ptr_as_binary_data == False: return "ctypes.c_wchar_p" elif declarations.is_same( declarations.void_t(), no_ptr ): return "ctypes.c_void_p" else: - base_visitor = type_converter_t( self.user_type.base, self.decl_formatter ) + base_visitor = self.create_converter( self.user_type.base ) internal_type_str = declarations.apply_visitor( base_visitor, base_visitor.user_type ) if declarations.is_calldef_pointer( self.user_type ): return internal_type_str @@ -107,13 +111,12 @@ elif declarations.is_same( declarations.void_t(), no_ref ): return "ctypes.c_void_p" else: - base_visitor = type_converter_t( self.user_type.base, self.decl_formatter ) + base_visitor = self.create_converter( self.user_type.base ) internal_type_str = declarations.apply_visitor( base_visitor, base_visitor.user_type ) return "ctypes.POINTER( %s )" % internal_type_str def visit_array( self ): - item_visitor = type_converter_t( declarations.array_item_type(self.user_type) - , self.decl_formatter ) + item_visitor = self.create_converter( declarations.array_item_type(self.user_type) ) item_type = declarations.apply_visitor( item_visitor, item_visitor.user_type ) size = declarations.array_size( self.user_type ) if size == declarations.array_t.SIZE_UNKNOWN: @@ -121,11 +124,11 @@ return "( %s * %d )" % ( item_type, size ) def visit_free_function_type( self ): - return_visitor = type_converter_t( self.user_type.return_type, self.decl_formatter ) - return_type = declarations.apply_visitor(return_visitor, self.user_type.return_type) + return_visitor = self.create_converter( self.user_type.return_type ) + return_type = declarations.apply_visitor( return_visitor, self.user_type.return_type ) argtypes = [] for arg in self.user_type.arguments_types: - arg_visitor = type_converter_t( arg, self.decl_formatter ) + arg_visitor = self.create_converter( arg ) argtypes.append( declarations.apply_visitor(arg_visitor, arg) ) return declarations.call_invocation.join( "ctypes.CFUNCTYPE", [return_type] + argtypes ) @@ -138,19 +141,19 @@ def visit_declarated( self ): #TODO: the follwoing code removes typedefs if isinstance( self.user_type.declaration, declarations.typedef_t ): - base_visitor = type_converter_t( self.user_type.declaration.type, self.decl_formatter ) + base_visitor = self.create_converter( self.user_type.declaration.type ) return declarations.apply_visitor( base_visitor, base_visitor.user_type ) else: return self.decl_formatter( self.user_type.declaration ) def visit_restrict( self ): - base_visitor = type_converter_t( self.user_type.base, self.decl_formatter ) + base_visitor = self.create_converter( self.user_type.base ) return declarations.apply_visitor( base_visitor, base_visitor.user_type ) def visit_ellipsis( self ): return '' -def as_ctype( type_, decl_formatter=algorithm.complete_py_name ): - v = type_converter_t( type_, decl_formatter ) +def as_ctype( type_, treat_char_ptr_as_binary_data=False): + v = type_converter_t( type_, treat_char_ptr_as_binary_data ) return declarations.apply_visitor( v, type_ ) Deleted: pyplusplus_dev/pyplusplus/code_creators/ctypes_module.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/ctypes_module.py 2009-12-26 20:13:12 UTC (rev 1785) +++ pyplusplus_dev/pyplusplus/code_creators/ctypes_module.py 2009-12-27 20:43:34 UTC (rev 1786) @@ -1,30 +0,0 @@ -# Copyright 2004-2008 Roman Yakovenko. -# 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) - -import os -import module -import library_reference -from pygccxml import utils - -class ctypes_module_t(module.module_t): - """This class represents the source code for the entire extension module. - - The root of the code creator tree is always a module_t object. - """ - def __init__(self, global_ns): - """Constructor. - """ - module.module_t.__init__(self, global_ns, ctypes_module_t.CODE_GENERATOR_TYPES.CTYPES) - - def _create_impl(self): - return self.create_internal_code( self.creators, indent_code=False ) - - @utils.cached - def library_var_name(self): - for creator in self.creators: - if isinstance( creator, library_reference.library_reference_t ): - return creator.library_var_name - else: - raise RuntimeError( "Internal Error: library_reference_t creator was not created" ) Modified: pyplusplus_dev/pyplusplus/code_creators/global_variable.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/global_variable.py 2009-12-26 20:13:12 UTC (rev 1785) +++ pyplusplus_dev/pyplusplus/code_creators/global_variable.py 2009-12-27 20:43:34 UTC (rev 1786) @@ -192,7 +192,7 @@ def _create_impl( self ): return '%(alias)s = %(type)s.in_dll( %(library_var_name)s, %(library_var_name)s.undecorated_names["%(undecorated_decl_name)s"] )' \ % dict( alias=self.alias - , type=ctypes_formatter.as_ctype( self.declaration.type ) + , type=ctypes_formatter.as_ctype( self.declaration.type, self.top_parent.treat_char_ptr_as_binary_data ) , library_var_name=self.top_parent.library_var_name , undecorated_decl_name=self.undecorated_decl_name ) Modified: pyplusplus_dev/pyplusplus/code_creators/member_variable.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/member_variable.py 2009-12-26 20:13:12 UTC (rev 1785) +++ pyplusplus_dev/pyplusplus/code_creators/member_variable.py 2009-12-27 20:43:34 UTC (rev 1786) @@ -736,7 +736,7 @@ vars.sort( key=lambda d: d.location.line ) for v in vars: tmp = None - type_as_str = ctypes_formatter.as_ctype( v.type ) + type_as_str = ctypes_formatter.as_ctype( v.type, self.top_parent.treat_char_ptr_as_binary_data ) if v.bits != None: tmp = '("%(name)s", %(type)s, %(bits)d),' \ % dict( name=v.alias, type=type_as_str, bits=v.bits ) Modified: pyplusplus_dev/pyplusplus/code_creators/module.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/module.py 2009-12-26 20:13:12 UTC (rev 1785) +++ pyplusplus_dev/pyplusplus/code_creators/module.py 2009-12-27 20:43:34 UTC (rev 1786) @@ -237,7 +237,8 @@ """Constructor. """ module_t.__init__(self, global_ns, ctypes_module_t.CODE_GENERATOR_TYPES.CTYPES) - + self.treat_char_ptr_as_binary_data = False + def _create_impl(self): return self.create_internal_code( self.creators, indent_code=False ) Modified: pyplusplus_dev/pyplusplus/code_creators/typedef_as_pyvar.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/typedef_as_pyvar.py 2009-12-26 20:13:12 UTC (rev 1785) +++ pyplusplus_dev/pyplusplus/code_creators/typedef_as_pyvar.py 2009-12-27 20:43:34 UTC (rev 1786) @@ -16,7 +16,7 @@ def _create_impl(self): return "%(complete_py_name)s = %(type)s" \ % dict( complete_py_name=self.complete_py_name - , type=ctypes_formatter.as_ctype( self.declaration.type ) ) + , type=ctypes_formatter.as_ctype( self.declaration.type, self.top_parent.treat_char_ptr_as_binary_data ) ) def _get_system_files_impl( self ): return [] Modified: pyplusplus_dev/unittests/ctypes_tester.py =================================================================== --- pyplusplus_dev/unittests/ctypes_tester.py 2009-12-26 20:13:12 UTC (rev 1785) +++ pyplusplus_dev/unittests/ctypes_tester.py 2009-12-27 20:43:34 UTC (rev 1786) @@ -49,6 +49,9 @@ def customize(self, mb ): pass + def customize_cc( self, mb ): + pass + def __build_scons_cmd( self ): cmd = autoconfig.scons.cmd_build + ' ' + self.base_name if autoconfig.cxx_parsers_cfg.gccxml.compiler == 'msvc71': @@ -66,8 +69,9 @@ autoconfig.scons_config.compile( self.__build_scons_cmd(), cwd=autoconfig.this_module_dir_path ) mb = ctypes_module_builder_t( [self.header], self.symbols_file, autoconfig.cxx_parsers_cfg.gccxml ) - self.customize( mb ) + self.customize( mb ) mb.build_code_creator( self.library_file ) + self.customize_cc( mb ) mb.write_module( os.path.join( self.project_dir, 'binaries', self.base_name + '.py' ) ) sys.path.insert( 0, os.path.join( self.project_dir, 'binaries' ) ) __import__( self.base_name ) @@ -212,6 +216,23 @@ #TODO: sort structs and classes by dependencies pass #just test that module could be loaded + +class char_ptr_as_binary_data_tester_t( ctypes_base_tester_t ): + def __init__( self, *args, **keywd ): + ctypes_base_tester_t.__init__( self, 'char_ptr_as_binary_data', *args, **keywd ) + + def customize_cc( self, mb ): + mb.code_creator.treat_char_ptr_as_binary_data = True + + def test(self): + data = self.module_ref.get_empty() + self.failUnless( data.contents.size == 0 ) + self.failUnless( not data.contents.bytes ) + + data = self.module_ref.get_hello_world() + self.failUnless( data.contents.size == len( "hello world" ) ) + self.failUnless( data.contents.bytes[0:data.contents.size + 1] == "hello\0world\0" ) + def create_suite(): #part of this functionality is going to be deprecated suite = unittest.TestSuite() @@ -223,6 +244,7 @@ suite.addTest( unittest.makeSuite(varargs_tester_t)) suite.addTest( unittest.makeSuite(circular_references_tester_t)) suite.addTest( unittest.makeSuite(function_ptr_as_variable_tester_t)) + suite.addTest( unittest.makeSuite(char_ptr_as_binary_data_tester_t)) return suite def run_suite(): Added: pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/char_ptr_as_binary_data.cpp =================================================================== --- pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/char_ptr_as_binary_data.cpp (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/char_ptr_as_binary_data.cpp 2009-12-27 20:43:34 UTC (rev 1786) @@ -0,0 +1,15 @@ +#include "char_ptr_as_binary_data.h" + +EXPORT_SYMBOL data_t* get_empty(){ + data_t* x = new data_t(); + x->size = 0; + x->bytes = 0; + return x; +} + +EXPORT_SYMBOL data_t* get_hello_world(){ + data_t* x = new data_t(); + x->size = 11; + x->bytes = "hello\0world"; + return x; +} Added: pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/char_ptr_as_binary_data.h =================================================================== --- pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/char_ptr_as_binary_data.h (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/char_ptr_as_binary_data.h 2009-12-27 20:43:34 UTC (rev 1786) @@ -0,0 +1,11 @@ +#include "libconfig.h" + +struct EXPORT_SYMBOL data_t{ + unsigned int size; + char const * bytes; +}; + +EXPORT_SYMBOL data_t* get_empty(); +EXPORT_SYMBOL data_t* get_hello_world(); + + Added: pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/sconscript =================================================================== --- pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/sconscript (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/char_ptr_as_binary_data/sconscript 2009-12-27 20:43:34 UTC (rev 1786) @@ -0,0 +1,7 @@ +Import('*') + +target_name = 'char_ptr_as_binary_data' +shlib = env.SharedLibrary( target=target_name + , source=[ target_name + '.cpp' ] + , CPPPATH=['#data'] ) +env.Alias( target_name, shlib ) Modified: pyplusplus_dev/unittests/sconstruct =================================================================== --- pyplusplus_dev/unittests/sconstruct 2009-12-26 20:13:12 UTC (rev 1785) +++ pyplusplus_dev/unittests/sconstruct 2009-12-27 20:43:34 UTC (rev 1786) @@ -33,7 +33,8 @@ , 'varargs' , 'templates' , 'circular_references' - , 'function_ptr_as_variable' ] + , 'function_ptr_as_variable' + , 'char_ptr_as_binary_data' ] for s in scripts: SConscript( 'data/ctypes/%s/sconscript' % s This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2009-12-26 20:13:20
|
Revision: 1785 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1785&view=rev Author: roman_yakovenko Date: 2009-12-26 20:13:12 +0000 (Sat, 26 Dec 2009) Log Message: ----------- ctypes code generator created wrong code for callback functions - this commit fixes the issue and introduces the tester Modified Paths: -------------- pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py pyplusplus_dev/unittests/ctypes_tester.py pyplusplus_dev/unittests/sconstruct Added Paths: ----------- pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/ pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/ pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/ctypes_utils.py pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/exposed_decl.pypp.txt pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/function_ptr_as_variable.os pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/function_ptr_as_variable.py pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/function_ptr_as_variable.cpp pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/function_ptr_as_variable.h pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/sconscript Modified: pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py 2009-12-26 19:21:49 UTC (rev 1784) +++ pyplusplus_dev/pyplusplus/code_creators/ctypes_formatter.py 2009-12-26 20:13:12 UTC (rev 1785) @@ -93,7 +93,10 @@ else: base_visitor = type_converter_t( self.user_type.base, self.decl_formatter ) internal_type_str = declarations.apply_visitor( base_visitor, base_visitor.user_type ) - return "ctypes.POINTER( %s )" % internal_type_str + if declarations.is_calldef_pointer( self.user_type ): + return internal_type_str + else: + return "ctypes.POINTER( %s )" % internal_type_str def visit_reference( self ): no_ref = declarations.remove_const( declarations.remove_reference( self.user_type ) ) Modified: pyplusplus_dev/unittests/ctypes_tester.py =================================================================== --- pyplusplus_dev/unittests/ctypes_tester.py 2009-12-26 19:21:49 UTC (rev 1784) +++ pyplusplus_dev/unittests/ctypes_tester.py 2009-12-26 20:13:12 UTC (rev 1785) @@ -171,6 +171,22 @@ self.failUnless( self.module_ref.get_value_data_p() == 34 ) +class function_ptr_as_variable_tester_t( ctypes_base_tester_t ): + def __init__( self, *args, **keywd ): + ctypes_base_tester_t.__init__( self, 'function_ptr_as_variable', *args, **keywd ) + + def customize( self, mb ): + mb.global_ns.typedef('do_smth_fun_t').include() + + @staticmethod + def identity(v): + return v + + def test(self): + info = self.module_ref.info() + info.do_smth_fun = self.module_ref.do_smth_fun_t(self.identity) + self.failUnless( 21 == self.module_ref.execute_callback( info, 21 ) ) + class varargs_tester_t( ctypes_base_tester_t ): def __init__( self, *args, **keywd ): ctypes_base_tester_t.__init__( self, 'varargs', *args, **keywd ) @@ -206,6 +222,7 @@ suite.addTest( unittest.makeSuite(variables_tester_t)) suite.addTest( unittest.makeSuite(varargs_tester_t)) suite.addTest( unittest.makeSuite(circular_references_tester_t)) + suite.addTest( unittest.makeSuite(function_ptr_as_variable_tester_t)) return suite def run_suite(): Added: pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/ctypes_utils.py =================================================================== --- pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/ctypes_utils.py (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/ctypes_utils.py 2009-12-26 20:13:12 UTC (rev 1785) @@ -0,0 +1,135 @@ +# This file has been generated by Py++. + +# Copyright 2004-2008 Roman Yakovenko. +# 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) + +import os +import ctypes + +# what is the best way to treat overloaded constructors +class native_callable( object ): + def __init__(self, dll, name, restype=None, argtypes=None ): + self.name = name + self.func = getattr( dll, dll.undecorated_names[name] ) + self.func.restype = restype + self.func.argtypes = argtypes + + def __call__(self, *args, **keywd ): + return self.func( *args, **keywd ) + +class native_overloaded_callable( object ): + def __init__(self, functions ): + self.__functions = functions + + def __call__( self, *args ): + types = None + if args: + types = tuple(arg.__class__ for arg in args) + f = self.__functions.get(types) + if f is None: + msg = ['Unable to find a function that match the arguments you passed.'] + msg.append( 'First argument type is "this" type.' ) + msg.append( 'This function call argument types: ' + str( types ) ) + msg.append( 'Registered methods argument types: ' ) + for key in self.__functions.iterkeys(): + msg.append(' ' + str(key)) + raise TypeError(os.linesep.join(msg)) + else: + return f(*args) + +class multi_method_registry_t: + def __init__( self, factory, restype ): + self.factory = factory + self.restype = restype + self.__functions = {} + + def register( self, callable_or_name, argtypes=None ): + if isinstance( callable_or_name, native_callable ): + callable = callable_or_name + else: + name = callable_or_name + callable = self.factory( name, restype=self.restype, argtypes=argtypes ) + self.__functions[ tuple(callable.func.argtypes) ] = callable.func + return self + + def finalize(self): + return native_overloaded_callable( self.__functions ) + + +class mem_fun_factory( object ): + def __init__( self, dll, wrapper, class_name, namespace='' ): + self.dll = dll + self.namespace = namespace + self.class_name = class_name + self.this_type = ctypes.POINTER( wrapper ) + + def __call__( self, name, **keywd ): + if 'argtypes' not in keywd or keywd['argtypes'] is None: + keywd['argtypes'] = [ self.this_type ] + else: + keywd['argtypes'].insert( 0, self.this_type ) + return native_callable( self.dll, name, **keywd ) + + def __get_ns_name(self): + if self.namespace: + return self.namespace + '::' + else: + return '' + + def default_constructor( self ): + return self( '%(ns)s%(class_name)s::%(class_name)s(void)' + % dict( ns=self.__get_ns_name() + , class_name=self.class_name ) ) + + def constructor( self, argtypes_str, **keywd ): + return self( '%(ns)s%(class_name)s::%(class_name)s(%(args)s)' + % dict( ns=self.__get_ns_name() + , class_name=self.class_name + , args=argtypes_str ) + , **keywd ) + + def copy_constructor( self ): + return self( '%(ns)s%(class_name)s::%(class_name)s(%(ns)s%(class_name)s const &)' + % dict( ns=self.__get_ns_name() + , class_name=self.class_name ) + , argtypes=[self.this_type] ) + + def destructor( self, is_virtual=False ): + virtuality = '' + if is_virtual: + virtuality = 'virtual ' + return self( '%(virtuality)s%(ns)s%(class_name)s::~%(class_name)s(void)' + % dict( ns=self.__get_ns_name() + , virtuality=virtuality + , class_name=self.class_name ) ) + + def operator_assign( self ): + return self( '%(ns)s%(class_name)s & %(class_name)s::operator=(%(class_name)s const &)' + % dict( ns=self.__get_ns_name() + , class_name=self.class_name ) + , restype=self.this_type + , argtypes=[self.this_type] ) + + def method( self, name, restype_str=None, argtypes_str=None, **keywd ): + if None is restype_str: + restype_str = 'void' + if None is argtypes_str: + argtypes_str = 'void' + + return self( '%(return_)s %(ns)s%(class_name)s::%(method_name)s(%(args)s)' + % dict( return_=restype_str + , ns=self.__get_ns_name() + , class_name=self.class_name + , method_name=name + , args=argtypes_str ) + , **keywd ) + + def multi_method( self, restype=None ): + return multi_method_registry_t( self, restype ) + + +#take a look on http://code.activestate.com/recipes/413486/ +Enumeration = ctypes.c_int + Added: pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/exposed_decl.pypp.txt =================================================================== --- pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/exposed_decl.pypp.txt (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/exposed_decl.pypp.txt 2009-12-26 20:13:12 UTC (rev 1785) @@ -0,0 +1,429 @@ ++@destructor_t@~info@ ( ::info::* )( ) ( ::info::* )( ) +~@destructor_t@~_IO_marker@ ( ::_IO_marker::* )( ) ( ::_IO_marker::* )( ) +~@destructor_t@~_IO_FILE@ ( ::_IO_FILE::* )( ) ( ::_IO_FILE::* )( ) +~@destructor_t@~._5@ ( ::_IO_cookie_io_functions_t::* )( ) ( ::_IO_cookie_io_functions_t::* )( ) +~@destructor_t@~._4@ ( ::_G_fpos64_t::* )( ) ( ::_G_fpos64_t::* )( ) +~@destructor_t@~._1@ ( ::__mbstate_t::* )( ) ( ::__mbstate_t::* )( ) +~@destructor_t@~._0@ ( ::__fsid_t::* )( ) ( ::__fsid_t::* )( ) +~@destructor_t@~._3@ ( ::_G_fpos_t::* )( ) ( ::_G_fpos_t::* )( ) +~@destructor_t@~._2@ ( ::__mbstate_t::* )( ) ( ::__mbstate_t::* )( ) +~@enumeration_t@__codecvt_result@::__codecvt_result +~@typedef_t@__uint16_t@::__uint16_t +~@typedef_t@cookie_close_function_t@::cookie_close_function_t +~@typedef_t@__uint64_t@::__uint64_t +~@typedef_t@__int16_t@::__int16_t +~@typedef_t@__ssize_t@::__ssize_t +~@typedef_t@__io_close_fn@::__io_close_fn +~@typedef_t@__mode_t@::__mode_t +~@typedef_t@__off64_t@::__off64_t +~@typedef_t@__u_char@::__u_char +~@typedef_t@_G_uint32_t@::_G_uint32_t +~@typedef_t@size_t@::size_t +~@typedef_t@__blksize_t@::__blksize_t +~@typedef_t@__u_long@::__u_long +~@typedef_t@__swblk_t@::__swblk_t +~@typedef_t@FILE@::FILE +~@typedef_t@__off_t@::__off_t +~@typedef_t@__fsblkcnt_t@::__fsblkcnt_t +~@typedef_t@__rlim_t@::__rlim_t +~@typedef_t@__fsfilcnt_t@::__fsfilcnt_t +~@typedef_t@__id_t@::__id_t +~@typedef_t@cookie_io_functions_t@::cookie_io_functions_t +~@typedef_t@__gid_t@::__gid_t +~@typedef_t@__clockid_t@::__clockid_t +~@typedef_t@__uint32_t@::__uint32_t +~@typedef_t@__useconds_t@::__useconds_t +~@typedef_t@__uint8_t@::__uint8_t +~@typedef_t@fpos_t@::fpos_t ++@typedef_t@do_smth_fun_t@::do_smth_fun_t +~@typedef_t@__io_read_fn@::__io_read_fn +~@typedef_t@__int32_t@::__int32_t +~@typedef_t@__daddr_t@::__daddr_t +~@typedef_t@__u_quad_t@::__u_quad_t +~@typedef_t@__u_short@::__u_short +~@typedef_t@__ino64_t@::__ino64_t +~@typedef_t@_G_int16_t@::_G_int16_t +~@typedef_t@va_list@::va_list +~@typedef_t@__loff_t@::__loff_t +~@typedef_t@__pid_t@::__pid_t +~@typedef_t@__FILE@::__FILE +~@typedef_t@__int64_t@::__int64_t +~@typedef_t@__io_seek_fn@::__io_seek_fn +~@typedef_t@__io_write_fn@::__io_write_fn +~@typedef_t@_G_uint16_t@::_G_uint16_t +~@typedef_t@__fsblkcnt64_t@::__fsblkcnt64_t +~@typedef_t@cookie_seek_function_t@::cookie_seek_function_t +~@typedef_t@__nlink_t@::__nlink_t +~@typedef_t@fpos64_t@::fpos64_t +~@typedef_t@__ino_t@::__ino_t +~@typedef_t@__dev_t@::__dev_t +~@typedef_t@cookie_write_function_t@::cookie_write_function_t +~@typedef_t@_IO_lock_t@::_IO_lock_t +~@typedef_t@__intptr_t@::__intptr_t +~@typedef_t@__time_t@::__time_t +~@typedef_t@__qaddr_t@::__qaddr_t +~@typedef_t@__caddr_t@::__caddr_t +~@typedef_t@__suseconds_t@::__suseconds_t +~@typedef_t@__clock_t@::__clock_t +~@typedef_t@__socklen_t@::__socklen_t +~@typedef_t@__u_int@::__u_int +~@typedef_t@__blkcnt_t@::__blkcnt_t +~@typedef_t@__fsfilcnt64_t@::__fsfilcnt64_t +~@typedef_t@__quad_t@::__quad_t +~@typedef_t@__blkcnt64_t@::__blkcnt64_t +~@typedef_t@__key_t@::__key_t +~@typedef_t@cookie_read_function_t@::cookie_read_function_t +~@typedef_t@_G_int32_t@::_G_int32_t +~@typedef_t@__gnuc_va_list@::__gnuc_va_list +~@typedef_t@__uid_t@::__uid_t +~@typedef_t@__rlim64_t@::__rlim64_t +~@typedef_t@__int8_t@::__int8_t +~@typedef_t@__timer_t@::__timer_t +~@namespace_t@std@::std +~@namespace_t@__cxxabiv1@::__cxxabiv1 +~@class_declaration_t@_IO_jump_t@::_IO_jump_t +~@class_declaration_t@obstack@::obstack +~@class_declaration_t@_IO_FILE_plus@::_IO_FILE_plus +~@class_declaration_t@_IO_cookie_file@::_IO_cookie_file +~@variable_t@_flags2@::_IO_FILE::_flags2 +~@variable_t@_vtable_offset@::_IO_FILE::_vtable_offset +~@variable_t@stdout@::stdout +~@variable_t@_IO_read_end@::_IO_FILE::_IO_read_end +~@variable_t@_unused2@::_IO_FILE::_unused2 +~@variable_t@_old_offset@::_IO_FILE::_old_offset +~@variable_t@_pos@::_IO_marker::_pos +~@variable_t@_IO_buf_end@::_IO_FILE::_IO_buf_end +~@variable_t@__pos@::_G_fpos_t::__pos +~@variable_t@__pos@::_G_fpos64_t::__pos +~@variable_t@_next@::_IO_marker::_next +~@variable_t@_mode@::_IO_FILE::_mode +~@variable_t@sys_nerr@::sys_nerr +~@variable_t@close@::_IO_cookie_io_functions_t::close +~@variable_t@_IO_save_base@::_IO_FILE::_IO_save_base +~@variable_t@_IO_read_base@::_IO_FILE::_IO_read_base +~@variable_t@seek@::_IO_cookie_io_functions_t::seek +~@variable_t@__state@::_G_fpos_t::__state +~@variable_t@__state@::_G_fpos64_t::__state +~@variable_t@sys_errlist@::sys_errlist +~@variable_t@_lock@::_IO_FILE::_lock +~@variable_t@_shortbuf@::_IO_FILE::_shortbuf +~@variable_t@_IO_2_1_stdin_@::_IO_2_1_stdin_ +~@variable_t@_sys_errlist@::_sys_errlist +~@variable_t@_IO_backup_base@::_IO_FILE::_IO_backup_base +~@variable_t@_chain@::_IO_FILE::_chain +~@variable_t@_IO_write_ptr@::_IO_FILE::_IO_write_ptr +~@variable_t@write@::_IO_cookie_io_functions_t::write +~@variable_t@_sys_nerr@::_sys_nerr ++@variable_t@do_smth_fun@::info::do_smth_fun +~@variable_t@_fileno@::_IO_FILE::_fileno +~@variable_t@__pad5@::_IO_FILE::__pad5 +~@variable_t@_flags@::_IO_FILE::_flags +~@variable_t@__wch@::__mbstate_t::__wch +~@variable_t@__pad4@::_IO_FILE::__pad4 +~@variable_t@_sbuf@::_IO_marker::_sbuf +~@variable_t@read@::_IO_cookie_io_functions_t::read +~@variable_t@__wchb@::__mbstate_t::__wchb +~@variable_t@_IO_write_end@::_IO_FILE::_IO_write_end +~@variable_t@_IO_2_1_stderr_@::_IO_2_1_stderr_ +~@variable_t@_IO_2_1_stdout_@::_IO_2_1_stdout_ +~@variable_t@__val@::__fsid_t::__val +~@variable_t@_cur_column@::_IO_FILE::_cur_column +~@variable_t@__count@::__mbstate_t::__count +~@variable_t@_IO_write_base@::_IO_FILE::_IO_write_base +~@variable_t@_IO_save_end@::_IO_FILE::_IO_save_end +~@variable_t@__pad1@::_IO_FILE::__pad1 +~@variable_t@_offset@::_IO_FILE::_offset +~@variable_t@__pad3@::_IO_FILE::__pad3 +~@variable_t@__pad2@::_IO_FILE::__pad2 +~@variable_t@_markers@::_IO_FILE::_markers +~@variable_t@_IO_read_ptr@::_IO_FILE::_IO_read_ptr +~@variable_t@stderr@::stderr +~@variable_t@__value@::__mbstate_t::__value +~@variable_t@stdin@::stdin +~@variable_t@_IO_buf_base@::_IO_FILE::_IO_buf_base ++@class_t@info@::info +~@class_t@__mbstate_t@::__mbstate_t +~@class_t@_G_fpos64_t@::_G_fpos64_t +~@class_t@_IO_cookie_io_functions_t@::_IO_cookie_io_functions_t +~@class_t@_IO_marker@::_IO_marker +~@class_t@_IO_FILE@::_IO_FILE +~@class_t@__fsid_t@::__fsid_t +~@class_t@('/usr/include/wchar.h', 87)@::__mbstate_t +~@class_t@_G_fpos_t@::_G_fpos_t ++@constructor_t@info@ ( ::info::* )( ::info const & ) ( ::info::* )( ::info const & ) ++@constructor_t@info@ ( ::info::* )( ) ( ::info::* )( ) +~@constructor_t@__mbstate_t@ ( ::__mbstate_t::* )( ::__mbstate_t const & ) ( ::__mbstate_t::* )( ::__mbstate_t const & ) +~@constructor_t@__mbstate_t@ ( ::__mbstate_t::* )( ) ( ::__mbstate_t::* )( ) +~@constructor_t@_G_fpos64_t@ ( ::_G_fpos64_t::* )( ::_G_fpos64_t const & ) ( ::_G_fpos64_t::* )( ::_G_fpos64_t const & ) +~@constructor_t@_G_fpos64_t@ ( ::_G_fpos64_t::* )( ) ( ::_G_fpos64_t::* )( ) +~@constructor_t@_IO_cookie_io_functions_t@ ( ::_IO_cookie_io_functions_t::* )( ::_IO_cookie_io_functions_t const & ) ( ::_IO_cookie_io_functions_t::* )( ::_IO_cookie_io_functions_t const & ) +~@constructor_t@_IO_cookie_io_functions_t@ ( ::_IO_cookie_io_functions_t::* )( ) ( ::_IO_cookie_io_functions_t::* )( ) +~@constructor_t@_IO_marker@ ( ::_IO_marker::* )( ::_IO_marker const & ) ( ::_IO_marker::* )( ::_IO_marker const & ) +~@constructor_t@_IO_marker@ ( ::_IO_marker::* )( ) ( ::_IO_marker::* )( ) +~@constructor_t@_IO_FILE@ ( ::_IO_FILE::* )( ::_IO_FILE const & ) ( ::_IO_FILE::* )( ::_IO_FILE const & ) +~@constructor_t@_IO_FILE@ ( ::_IO_FILE::* )( ) ( ::_IO_FILE::* )( ) +~@constructor_t@__fsid_t@ ( ::__fsid_t::* )( ::__fsid_t const & ) ( ::__fsid_t::* )( ::__fsid_t const & ) +~@constructor_t@__fsid_t@ ( ::__fsid_t::* )( ) ( ::__fsid_t::* )( ) +~@constructor_t@('/usr/include/wchar.h', 87)@ ( ::__mbstate_t::* )( ::__mbstate_t const & ) ( ::__mbstate_t::* )( ::__mbstate_t const & ) +~@constructor_t@('/usr/include/wchar.h', 87)@ ( ::__mbstate_t::* )( ) ( ::__mbstate_t::* )( ) +~@constructor_t@_G_fpos_t@ ( ::_G_fpos_t::* )( ::_G_fpos_t const & ) ( ::_G_fpos_t::* )( ::_G_fpos_t const & ) +~@constructor_t@_G_fpos_t@ ( ::_G_fpos_t::* )( ) ( ::_G_fpos_t::* )( ) +~@member_operator_t@operator=@::_IO_cookie_io_functions_t & ( ::_IO_cookie_io_functions_t::* )( ::_IO_cookie_io_functions_t const & ) ::_IO_cookie_io_functions_t & ( ::_IO_cookie_io_functions_t::* )( ::_IO_cookie_io_functions_t const & ) +~@member_operator_t@operator=@::_IO_FILE & ( ::_IO_FILE::* )( ::_IO_FILE const & ) ::_IO_FILE & ( ::_IO_FILE::* )( ::_IO_FILE const & ) +~@member_operator_t@operator=@::_G_fpos_t & ( ::_G_fpos_t::* )( ::_G_fpos_t const & ) ::_G_fpos_t & ( ::_G_fpos_t::* )( ::_G_fpos_t const & ) ++@member_operator_t@operator=@::info & ( ::info::* )( ::info const & ) ::info & ( ::info::* )( ::info const & ) +~@member_operator_t@operator=@::_G_fpos64_t & ( ::_G_fpos64_t::* )( ::_G_fpos64_t const & ) ::_G_fpos64_t & ( ::_G_fpos64_t::* )( ::_G_fpos64_t const & ) +~@member_operator_t@operator=@::__mbstate_t & ( ::__mbstate_t::* )( ::__mbstate_t const & ) ::__mbstate_t & ( ::__mbstate_t::* )( ::__mbstate_t const & ) +~@member_operator_t@operator=@::__mbstate_t & ( ::__mbstate_t::* )( ::__mbstate_t const & ) ::__mbstate_t & ( ::__mbstate_t::* )( ::__mbstate_t const & ) +~@member_operator_t@operator=@::__fsid_t & ( ::__fsid_t::* )( ::__fsid_t const & ) ::__fsid_t & ( ::__fsid_t::* )( ::__fsid_t const & ) +~@member_operator_t@operator=@::_IO_marker & ( ::_IO_marker::* )( ::_IO_marker const & ) ::_IO_marker & ( ::_IO_marker::* )( ::_IO_marker const & ) +~@free_function_t@__builtin_ldexpf@float (*)( float,int )float (*)( float,int ) +~@free_function_t@obstack_vprintf@int (*)( __restrict__ ::obstack *,__restrict__ char const *,::__gnuc_va_list )int (*)( __restrict__ ::obstack *,__restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@__builtin_tanhf@float (*)( float )float (*)( float ) +~@free_function_t@__builtin_ldexpl@long double (*)( long double,int )long double (*)( long double,int ) +~@free_function_t@_IO_putc@int (*)( int,::_IO_FILE * )int (*)( int,::_IO_FILE * ) +~@free_function_t@__builtin_inf@double (*)( )double (*)( ) +~@free_function_t@__builtin_prefetch@void (*)( void const *,... )void (*)( void const *,... ) +~@free_function_t@__builtin_popcount@int (*)( int )int (*)( int ) +~@free_function_t@__builtin_expf@float (*)( float )float (*)( float ) +~@free_function_t@__builtin_islessgreater@bool (*)( ... )bool (*)( ... ) +~@free_function_t@fseeko64@int (*)( ::FILE *,::__off64_t,int )int (*)( ::FILE *,::__off64_t,int ) +~@free_function_t@__builtin_cargf@float (*)( complex float )float (*)( complex float ) +~@free_function_t@__builtin_cpowl@complex long double (*)( complex long double,complex long double )complex long double (*)( complex long double,complex long double ) +~@free_function_t@fflush@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@__builtin_expl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@fputc@int (*)( int,::FILE * )int (*)( int,::FILE * ) +~@free_function_t@__underflow@int (*)( ::_IO_FILE * )int (*)( ::_IO_FILE * ) +~@free_function_t@fwrite@::size_t (*)( __restrict__ void const *,::size_t,::size_t,__restrict__ ::FILE * )::size_t (*)( __restrict__ void const *,::size_t,::size_t,__restrict__ ::FILE * ) +~@free_function_t@fflush_unlocked@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@__builtin_log10@double (*)( double )double (*)( double ) +~@free_function_t@_IO_cookie_init@void (*)( ::_IO_cookie_file *,int,void *,::_IO_cookie_io_functions_t )void (*)( ::_IO_cookie_file *,int,void *,::_IO_cookie_io_functions_t ) +~@free_function_t@fputs@int (*)( __restrict__ char const *,__restrict__ ::FILE * )int (*)( __restrict__ char const *,__restrict__ ::FILE * ) +~@free_function_t@__builtin_exp@double (*)( double )double (*)( double ) +~@free_function_t@tmpnam@char * (*)( char * )char * (*)( char * ) +~@free_function_t@feof_unlocked@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@__builtin_popcountll@int (*)( long long int )int (*)( long long int ) +~@free_function_t@getline@::__ssize_t (*)( __restrict__ char * *,__restrict__ ::size_t *,__restrict__ ::FILE * )::__ssize_t (*)( __restrict__ char * *,__restrict__ ::size_t *,__restrict__ ::FILE * ) +~@free_function_t@_IO_padn@::__ssize_t (*)( ::_IO_FILE *,int,::__ssize_t )::__ssize_t (*)( ::_IO_FILE *,int,::__ssize_t ) +~@free_function_t@__builtin_csinh@complex double (*)( complex double )complex double (*)( complex double ) +~@free_function_t@__builtin_acosf@float (*)( float )float (*)( float ) +~@free_function_t@__builtin_csin@complex double (*)( complex double )complex double (*)( complex double ) +~@free_function_t@__builtin_csinl@complex long double (*)( complex long double )complex long double (*)( complex long double ) +~@free_function_t@__builtin_acos@double (*)( double )double (*)( double ) +~@free_function_t@__builtin_ccosl@complex long double (*)( complex long double )complex long double (*)( complex long double ) +~@free_function_t@getc_unlocked@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@_IO_sgetn@::size_t (*)( ::_IO_FILE *,void *,::size_t )::size_t (*)( ::_IO_FILE *,void *,::size_t ) +~@free_function_t@__builtin_acosl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@__builtin_csinf@complex float (*)( complex float )complex float (*)( complex float ) +~@free_function_t@_IO_ftrylockfile@int (*)( ::_IO_FILE * )int (*)( ::_IO_FILE * ) +~@free_function_t@__builtin_frame_address@void * (*)( unsigned int )void * (*)( unsigned int ) +~@free_function_t@__builtin_cpowf@complex float (*)( complex float,complex float )complex float (*)( complex float,complex float ) +~@free_function_t@__builtin_ctzll@int (*)( long long int )int (*)( long long int ) +~@free_function_t@renameat@int (*)( int,char const *,int,char const * )int (*)( int,char const *,int,char const * ) +~@free_function_t@fileno@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@gets@char * (*)( char * )char * (*)( char * ) +~@free_function_t@perror@void (*)( char const * )void (*)( char const * ) +~@free_function_t@__builtin_tanf@float (*)( float )float (*)( float ) +~@free_function_t@__builtin_tanh@double (*)( double )double (*)( double ) +~@free_function_t@freopen64@::FILE * (*)( __restrict__ char const *,__restrict__ char const *,__restrict__ ::FILE * )::FILE * (*)( __restrict__ char const *,__restrict__ char const *,__restrict__ ::FILE * ) +~@free_function_t@remove@int (*)( char const * )int (*)( char const * ) +~@free_function_t@__builtin_tanl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@__builtin_modff@float (*)( float,float * )float (*)( float,float * ) +~@free_function_t@__builtin_clogf@complex float (*)( complex float )complex float (*)( complex float ) +~@free_function_t@_IO_vfprintf@int (*)( __restrict__ ::_IO_FILE *,__restrict__ char const *,::__gnuc_va_list )int (*)( __restrict__ ::_IO_FILE *,__restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@freopen@::FILE * (*)( __restrict__ char const *,__restrict__ char const *,__restrict__ ::FILE * )::FILE * (*)( __restrict__ char const *,__restrict__ char const *,__restrict__ ::FILE * ) +~@free_function_t@__builtin_clogl@complex long double (*)( complex long double )complex long double (*)( complex long double ) ++@free_function_t@execute_callback@int (*)( ::info *,int )int (*)( ::info *,int ) +~@free_function_t@__builtin_modfl@long double (*)( long double,long double * )long double (*)( long double,long double * ) +~@free_function_t@fread_unlocked@::size_t (*)( __restrict__ void *,::size_t,::size_t,__restrict__ ::FILE * )::size_t (*)( __restrict__ void *,::size_t,::size_t,__restrict__ ::FILE * ) +~@free_function_t@__builtin_atan@double (*)( double )double (*)( double ) +~@free_function_t@__builtin_sqrt@double (*)( double )double (*)( double ) +~@free_function_t@__builtin_isunordered@bool (*)( ... )bool (*)( ... ) +~@free_function_t@tempnam@char * (*)( char const *,char const * )char * (*)( char const *,char const * ) +~@free_function_t@tmpfile@::FILE * (*)( )::FILE * (*)( ) +~@free_function_t@vsscanf@int (*)( __restrict__ char const *,__restrict__ char const *,::__gnuc_va_list )int (*)( __restrict__ char const *,__restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@__builtin_ctanhf@complex float (*)( complex float )complex float (*)( complex float ) +~@free_function_t@__builtin_fabsf@float (*)( float )float (*)( float ) +~@free_function_t@snprintf@int (*)( __restrict__ char *,::size_t,__restrict__ char const *,... )int (*)( __restrict__ char *,::size_t,__restrict__ char const *,... ) +~@free_function_t@__builtin_csqrtl@complex long double (*)( complex long double )complex long double (*)( complex long double ) +~@free_function_t@fgetc@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@pclose@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@__builtin_ctzl@int (*)( long int )int (*)( long int ) +~@free_function_t@__builtin_ceill@long double (*)( long double )long double (*)( long double ) +~@free_function_t@__builtin_ctanhl@complex long double (*)( complex long double )complex long double (*)( complex long double ) +~@free_function_t@__builtin_fabsl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@__builtin_cargl@long double (*)( complex long double )long double (*)( complex long double ) +~@free_function_t@fileno_unlocked@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@fgets_unlocked@char * (*)( __restrict__ char *,int,__restrict__ ::FILE * )char * (*)( __restrict__ char *,int,__restrict__ ::FILE * ) +~@free_function_t@fgets@char * (*)( __restrict__ char *,int,__restrict__ ::FILE * )char * (*)( __restrict__ char *,int,__restrict__ ::FILE * ) +~@free_function_t@ctermid@char * (*)( char * )char * (*)( char * ) +~@free_function_t@__builtin_sinf@float (*)( float )float (*)( float ) +~@free_function_t@__builtin_inff@float (*)( )float (*)( ) +~@free_function_t@_IO_feof@int (*)( ::_IO_FILE * )int (*)( ::_IO_FILE * ) +~@free_function_t@getchar_unlocked@int (*)( )int (*)( ) +~@free_function_t@__builtin_atan2l@long double (*)( long double,long double )long double (*)( long double,long double ) +~@free_function_t@fgetc_unlocked@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@__builtin_fabs@double (*)( double )double (*)( double ) +~@free_function_t@fgetpos@int (*)( __restrict__ ::FILE *,__restrict__ ::fpos_t * )int (*)( __restrict__ ::FILE *,__restrict__ ::fpos_t * ) +~@free_function_t@__builtin_atan2f@float (*)( float,float )float (*)( float,float ) +~@free_function_t@__builtin_isfinite@bool (*)( ... )bool (*)( ... ) +~@free_function_t@__builtin_sinh@double (*)( double )double (*)( double ) +~@free_function_t@fsetpos@int (*)( ::FILE *,::fpos_t const * )int (*)( ::FILE *,::fpos_t const * ) +~@free_function_t@ftell@long int (*)( ::FILE * )long int (*)( ::FILE * ) +~@free_function_t@__builtin_floor@double (*)( double )double (*)( double ) +~@free_function_t@sprintf@int (*)( __restrict__ char *,__restrict__ char const *,... )int (*)( __restrict__ char *,__restrict__ char const *,... ) +~@free_function_t@__builtin_cabsl@long double (*)( complex long double )long double (*)( complex long double ) +~@free_function_t@vscanf@int (*)( __restrict__ char const *,::__gnuc_va_list )int (*)( __restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@__builtin_popcountl@int (*)( long int )int (*)( long int ) +~@free_function_t@__builtin_cabsf@float (*)( complex float )float (*)( complex float ) +~@free_function_t@ferror_unlocked@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@fgetpos64@int (*)( __restrict__ ::FILE *,__restrict__ ::fpos64_t * )int (*)( __restrict__ ::FILE *,__restrict__ ::fpos64_t * ) +~@free_function_t@__getdelim@::__ssize_t (*)( __restrict__ char * *,__restrict__ ::size_t *,int,__restrict__ ::FILE * )::__ssize_t (*)( __restrict__ char * *,__restrict__ ::size_t *,int,__restrict__ ::FILE * ) +~@free_function_t@__overflow@int (*)( ::_IO_FILE *,int )int (*)( ::_IO_FILE *,int ) +~@free_function_t@asprintf@int (*)( __restrict__ char * *,__restrict__ char const *,... )int (*)( __restrict__ char * *,__restrict__ char const *,... ) +~@free_function_t@ferror@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@__builtin_csqrtf@complex float (*)( complex float )complex float (*)( complex float ) +~@free_function_t@__builtin_csinhl@complex long double (*)( complex long double )complex long double (*)( complex long double ) +~@free_function_t@open_memstream@::FILE * (*)( char * *,::size_t * )::FILE * (*)( char * *,::size_t * ) +~@free_function_t@__builtin_coshf@float (*)( float )float (*)( float ) +~@free_function_t@fsetpos64@int (*)( ::FILE *,::fpos64_t const * )int (*)( ::FILE *,::fpos64_t const * ) +~@free_function_t@__builtin_ccos@complex double (*)( complex double )complex double (*)( complex double ) +~@free_function_t@__builtin_ccosh@complex double (*)( complex double )complex double (*)( complex double ) +~@free_function_t@__builtin_csinhf@complex float (*)( complex float )complex float (*)( complex float ) +~@free_function_t@__builtin_coshl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@tmpnam_r@char * (*)( char * )char * (*)( char * ) +~@free_function_t@_IO_seekpos@::__off64_t (*)( ::_IO_FILE *,::__off64_t,int )::__off64_t (*)( ::_IO_FILE *,::__off64_t,int ) +~@free_function_t@fseeko@int (*)( ::FILE *,::__off_t,int )int (*)( ::FILE *,::__off_t,int ) +~@free_function_t@putchar@int (*)( int )int (*)( int ) +~@free_function_t@__builtin_isinf@bool (*)( ... )bool (*)( ... ) +~@free_function_t@__builtin_ctz@int (*)( int )int (*)( int ) +~@free_function_t@__builtin_powi@double (*)( double,int )double (*)( double,int ) +~@free_function_t@fseek@int (*)( ::FILE *,long int,int )int (*)( ::FILE *,long int,int ) +~@free_function_t@__builtin_powl@long double (*)( long double,long double )long double (*)( long double,long double ) +~@free_function_t@__builtin_csqrt@complex double (*)( complex double )complex double (*)( complex double ) +~@free_function_t@__builtin_cexpl@complex long double (*)( complex long double )complex long double (*)( complex long double ) +~@free_function_t@_IO_ferror@int (*)( ::_IO_FILE * )int (*)( ::_IO_FILE * ) +~@free_function_t@fputc_unlocked@int (*)( int,::FILE * )int (*)( int,::FILE * ) +~@free_function_t@clearerr_unlocked@void (*)( ::FILE * )void (*)( ::FILE * ) +~@free_function_t@__builtin_cexpf@complex float (*)( complex float )complex float (*)( complex float ) +~@free_function_t@_IO_peekc_locked@int (*)( ::_IO_FILE * )int (*)( ::_IO_FILE * ) +~@free_function_t@scanf@int (*)( __restrict__ char const *,... )int (*)( __restrict__ char const *,... ) +~@free_function_t@__builtin_asinf@float (*)( float )float (*)( float ) +~@free_function_t@_IO_flockfile@void (*)( ::_IO_FILE * )void (*)( ::_IO_FILE * ) +~@free_function_t@__builtin_cpow@complex double (*)( complex double,complex double )complex double (*)( complex double,complex double ) +~@free_function_t@fcloseall@int (*)( )int (*)( ) +~@free_function_t@obstack_printf@int (*)( __restrict__ ::obstack *,__restrict__ char const *,... )int (*)( __restrict__ ::obstack *,__restrict__ char const *,... ) +~@free_function_t@__builtin_cexp@complex double (*)( complex double )complex double (*)( complex double ) +~@free_function_t@__builtin_cabs@double (*)( complex double )double (*)( complex double ) +~@free_function_t@__builtin_asinl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@getdelim@::__ssize_t (*)( __restrict__ char * *,__restrict__ ::size_t *,int,__restrict__ ::FILE * )::__ssize_t (*)( __restrict__ char * *,__restrict__ ::size_t *,int,__restrict__ ::FILE * ) +~@free_function_t@__builtin_ctanl@complex long double (*)( complex long double )complex long double (*)( complex long double ) +~@free_function_t@__builtin_atan2@double (*)( double,double )double (*)( double,double ) +~@free_function_t@__builtin_frexpf@float (*)( float,int * )float (*)( float,int * ) +~@free_function_t@__uflow@int (*)( ::_IO_FILE * )int (*)( ::_IO_FILE * ) +~@free_function_t@tmpfile64@::FILE * (*)( )::FILE * (*)( ) +~@free_function_t@printf@int (*)( __restrict__ char const *,... )int (*)( __restrict__ char const *,... ) +~@free_function_t@fmemopen@::FILE * (*)( void *,::size_t,char const * )::FILE * (*)( void *,::size_t,char const * ) +~@free_function_t@fopen@::FILE * (*)( __restrict__ char const *,__restrict__ char const * )::FILE * (*)( __restrict__ char const *,__restrict__ char const * ) +~@free_function_t@getchar@int (*)( )int (*)( ) +~@free_function_t@putw@int (*)( int,::FILE * )int (*)( int,::FILE * ) +~@free_function_t@__builtin_expect@long int (*)( long int,long int )long int (*)( long int,long int ) +~@free_function_t@puts@int (*)( char const * )int (*)( char const * ) +~@free_function_t@__builtin_ctanf@complex float (*)( complex float )complex float (*)( complex float ) +~@free_function_t@fdopen@::FILE * (*)( int,char const * )::FILE * (*)( int,char const * ) +~@free_function_t@__builtin_ctanh@complex double (*)( complex double )complex double (*)( complex double ) +~@free_function_t@__builtin_islessequal@bool (*)( ... )bool (*)( ... ) +~@free_function_t@__builtin_carg@double (*)( complex double )double (*)( complex double ) +~@free_function_t@__builtin_memchr@void * (*)( void const *,int,unsigned int )void * (*)( void const *,int,unsigned int ) +~@free_function_t@__builtin_sqrtl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@fclose@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@__builtin_nans@double (*)( char const * )double (*)( char const * ) +~@free_function_t@__builtin_frexpl@long double (*)( long double,int * )long double (*)( long double,int * ) +~@free_function_t@__asprintf@int (*)( __restrict__ char * *,__restrict__ char const *,... )int (*)( __restrict__ char * *,__restrict__ char const *,... ) +~@free_function_t@dprintf@int (*)( int,__restrict__ char const *,... )int (*)( int,__restrict__ char const *,... ) +~@free_function_t@__builtin_isnormal@bool (*)( ... )bool (*)( ... ) +~@free_function_t@__builtin_floorf@float (*)( float )float (*)( float ) +~@free_function_t@ftello64@::__off64_t (*)( ::FILE * )::__off64_t (*)( ::FILE * ) +~@free_function_t@__builtin_atanf@float (*)( float )float (*)( float ) +~@free_function_t@__builtin_clog@complex double (*)( complex double )complex double (*)( complex double ) +~@free_function_t@__builtin_floorl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@__builtin_return@void (*)( void * )void (*)( void * ) +~@free_function_t@__builtin_powil@long double (*)( long double,int )long double (*)( long double,int ) +~@free_function_t@setlinebuf@void (*)( ::FILE * )void (*)( ::FILE * ) +~@free_function_t@__builtin_log@double (*)( double )double (*)( double ) +~@free_function_t@__builtin_atanl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@__builtin_log10l@long double (*)( long double )long double (*)( long double ) +~@free_function_t@__builtin_sqrtf@float (*)( float )float (*)( float ) +~@free_function_t@__builtin_powf@float (*)( float,float )float (*)( float,float ) +~@free_function_t@__builtin_tanhl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@__builtin_log10f@float (*)( float )float (*)( float ) +~@free_function_t@__builtin_tan@double (*)( double )double (*)( double ) +~@free_function_t@fopencookie@::FILE * (*)( __restrict__ void *,__restrict__ char const *,::_IO_cookie_io_functions_t )::FILE * (*)( __restrict__ void *,__restrict__ char const *,::_IO_cookie_io_functions_t ) +~@free_function_t@__builtin_infl@long double (*)( )long double (*)( ) +~@free_function_t@fscanf@int (*)( __restrict__ ::FILE *,__restrict__ char const *,... )int (*)( __restrict__ ::FILE *,__restrict__ char const *,... ) +~@free_function_t@__builtin_frexp@double (*)( double,int * )double (*)( double,int * ) +~@free_function_t@ftrylockfile@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@cuserid@char * (*)( char * )char * (*)( char * ) +~@free_function_t@__builtin_ldexp@double (*)( double,int )double (*)( double,int ) +~@free_function_t@setbuffer@void (*)( __restrict__ ::FILE *,__restrict__ char *,::size_t )void (*)( __restrict__ ::FILE *,__restrict__ char *,::size_t ) +~@free_function_t@_IO_vfscanf@int (*)( __restrict__ ::_IO_FILE *,__restrict__ char const *,::__gnuc_va_list,__restrict__ int * )int (*)( __restrict__ ::_IO_FILE *,__restrict__ char const *,::__gnuc_va_list,__restrict__ int * ) +~@free_function_t@ungetc@int (*)( int,::FILE * )int (*)( int,::FILE * ) +~@free_function_t@fprintf@int (*)( __restrict__ ::FILE *,__restrict__ char const *,... )int (*)( __restrict__ ::FILE *,__restrict__ char const *,... ) +~@free_function_t@vsprintf@int (*)( __restrict__ char *,__restrict__ char const *,::__gnuc_va_list )int (*)( __restrict__ char *,__restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@rename@int (*)( char const *,char const * )int (*)( char const *,char const * ) +~@free_function_t@vsnprintf@int (*)( __restrict__ char *,::size_t,__restrict__ char const *,::__gnuc_va_list )int (*)( __restrict__ char *,::size_t,__restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@__builtin_sinhl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@sscanf@int (*)( __restrict__ char const *,__restrict__ char const *,... )int (*)( __restrict__ char const *,__restrict__ char const *,... ) +~@free_function_t@__builtin_powif@float (*)( float,int )float (*)( float,int ) +~@free_function_t@__builtin_sinhf@float (*)( float )float (*)( float ) +~@free_function_t@fread@::size_t (*)( __restrict__ void *,::size_t,::size_t,__restrict__ ::FILE * )::size_t (*)( __restrict__ void *,::size_t,::size_t,__restrict__ ::FILE * ) +~@free_function_t@ftello@::__off_t (*)( ::FILE * )::__off_t (*)( ::FILE * ) +~@free_function_t@fwrite_unlocked@::size_t (*)( __restrict__ void const *,::size_t,::size_t,__restrict__ ::FILE * )::size_t (*)( __restrict__ void const *,::size_t,::size_t,__restrict__ ::FILE * ) +~@free_function_t@popen@::FILE * (*)( char const *,char const * )::FILE * (*)( char const *,char const * ) +~@free_function_t@__builtin_ctan@complex double (*)( complex double )complex double (*)( complex double ) +~@free_function_t@__builtin_sin@double (*)( double )double (*)( double ) +~@free_function_t@vprintf@int (*)( __restrict__ char const *,::__gnuc_va_list )int (*)( __restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@_IO_seekoff@::__off64_t (*)( ::_IO_FILE *,::__off64_t,int,int )::__off64_t (*)( ::_IO_FILE *,::__off64_t,int,int ) +~@free_function_t@feof@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@putc@int (*)( int,::FILE * )int (*)( int,::FILE * ) +~@free_function_t@__builtin_logl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@__builtin_asin@double (*)( double )double (*)( double ) +~@free_function_t@clearerr@void (*)( ::FILE * )void (*)( ::FILE * ) +~@free_function_t@__builtin_logf@float (*)( float )float (*)( float ) +~@free_function_t@getc@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@__builtin_isgreater@bool (*)( ... )bool (*)( ... ) +~@free_function_t@putchar_unlocked@int (*)( int )int (*)( int ) +~@free_function_t@vfprintf@int (*)( __restrict__ ::FILE *,__restrict__ char const *,::__gnuc_va_list )int (*)( __restrict__ ::FILE *,__restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@rewind@void (*)( ::FILE * )void (*)( ::FILE * ) +~@free_function_t@putc_unlocked@int (*)( int,::FILE * )int (*)( int,::FILE * ) +~@free_function_t@vfscanf@int (*)( __restrict__ ::FILE *,__restrict__ char const *,::__gnuc_va_list )int (*)( __restrict__ ::FILE *,__restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@__builtin_isless@bool (*)( ... )bool (*)( ... ) +~@free_function_t@getw@int (*)( ::FILE * )int (*)( ::FILE * ) +~@free_function_t@flockfile@void (*)( ::FILE * )void (*)( ::FILE * ) +~@free_function_t@__builtin_nansf@float (*)( char const * )float (*)( char const * ) +~@free_function_t@__builtin_ccoshl@complex long double (*)( complex long double )complex long double (*)( complex long double ) +~@free_function_t@vasprintf@int (*)( __restrict__ char * *,__restrict__ char const *,::__gnuc_va_list )int (*)( __restrict__ char * *,__restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@_IO_free_backup_area@void (*)( ::_IO_FILE * )void (*)( ::_IO_FILE * ) +~@free_function_t@__builtin_ccoshf@complex float (*)( complex float )complex float (*)( complex float ) +~@free_function_t@__builtin_nansl@long double (*)( char const * )long double (*)( char const * ) +~@free_function_t@__builtin_return_address@void * (*)( unsigned int )void * (*)( unsigned int ) +~@free_function_t@__builtin_ceilf@float (*)( float )float (*)( float ) +~@free_function_t@__builtin_isnan@bool (*)( ... )bool (*)( ... ) +~@free_function_t@__builtin_ccosf@complex float (*)( complex float )complex float (*)( complex float ) +~@free_function_t@__builtin_cosf@float (*)( float )float (*)( float ) +~@free_function_t@fputs_unlocked@int (*)( __restrict__ char const *,__restrict__ ::FILE * )int (*)( __restrict__ char const *,__restrict__ ::FILE * ) +~@free_function_t@setbuf@void (*)( __restrict__ ::FILE *,__restrict__ char * )void (*)( __restrict__ ::FILE *,__restrict__ char * ) +~@free_function_t@__builtin_cosh@double (*)( double )double (*)( double ) +~@free_function_t@__builtin_isgreaterequal@bool (*)( ... )bool (*)( ... ) +~@free_function_t@__builtin_cosl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@funlockfile@void (*)( ::FILE * )void (*)( ::FILE * ) +~@free_function_t@vdprintf@int (*)( int,__restrict__ char const *,::__gnuc_va_list )int (*)( int,__restrict__ char const *,::__gnuc_va_list ) +~@free_function_t@__builtin_ceil@double (*)( double )double (*)( double ) +~@free_function_t@_IO_getc@int (*)( ::_IO_FILE * )int (*)( ::_IO_FILE * ) +~@free_function_t@__builtin_fmodf@float (*)( float,float )float (*)( float,float ) +~@free_function_t@__builtin_cos@double (*)( double )double (*)( double ) +~@free_function_t@fopen64@::FILE * (*)( __restrict__ char const *,__restrict__ char const * )::FILE * (*)( __restrict__ char const *,__restrict__ char const * ) +~@free_function_t@__builtin_fmodl@long double (*)( long double,long double )long double (*)( long double,long double ) +~@free_function_t@__builtin_sinl@long double (*)( long double )long double (*)( long double ) +~@free_function_t@setvbuf@int (*)( __restrict__ ::FILE *,__restrict__ char *,int,::size_t )int (*)( __restrict__ ::FILE *,__restrict__ char *,int,::size_t ) +~@free_function_t@_IO_funlockfile@void (*)( ::_IO_FILE * )void (*)( ::_IO_FILE * ) Added: pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/function_ptr_as_variable.os =================================================================== (Binary files differ) Property changes on: pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/function_ptr_as_variable.os ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/function_ptr_as_variable.py =================================================================== --- pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/function_ptr_as_variable.py (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/function_ptr_as_variable.py 2009-12-26 20:13:12 UTC (rev 1785) @@ -0,0 +1,24 @@ +# This file has been generated by Py++. + +import ctypes + +import ctypes_utils + +libfunction_ptr_as_variable_lib = ctypes.CDLL( r"/home/roman/language-binding/sources/pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/binaries/libfunction_ptr_as_variable.so" ) + +libfunction_ptr_as_variable_lib.undecorated_names = {#mapping between decorated and undecorated names + "extern int execute_callback(info * info, int arg1) [free function]" : "_Z16execute_callbackP4infoi", + "_Z16execute_callbackP4infoi" : "extern int execute_callback(info * info, int arg1) [free function]", +} + +class info(ctypes.Structure): + """class info""" + +info._fields_ = [ #class info + ("do_smth_fun", ctypes.CFUNCTYPE( ctypes.c_int, ctypes.c_int )), +] + +do_smth_fun_t = ctypes.CFUNCTYPE( ctypes.c_int, ctypes.c_int ) + +execute_callback_type = ctypes.CFUNCTYPE( ctypes.c_int, ctypes.POINTER( info ), ctypes.c_int ) +execute_callback = execute_callback_type( ( libfunction_ptr_as_variable_lib.undecorated_names["extern int execute_callback(info * info, int arg1) [free function]"], libfunction_ptr_as_variable_lib ) ) Added: pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/function_ptr_as_variable.cpp =================================================================== --- pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/function_ptr_as_variable.cpp (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/function_ptr_as_variable.cpp 2009-12-26 20:13:12 UTC (rev 1785) @@ -0,0 +1,5 @@ +#include "function_ptr_as_variable.h" + +EXPORT_SYMBOL int execute_callback(struct info* info, int v) { + return info->do_smth_fun(v); +} Added: pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/function_ptr_as_variable.h =================================================================== --- pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/function_ptr_as_variable.h (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/function_ptr_as_variable.h 2009-12-26 20:13:12 UTC (rev 1785) @@ -0,0 +1,11 @@ +#include "libconfig.h" +#include <stdio.h> + +typedef int do_smth_fun_t(int); + +struct EXPORT_SYMBOL info { + do_smth_fun_t* do_smth_fun; +}; + +EXPORT_SYMBOL int execute_callback(struct info* info, int); + Added: pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/sconscript =================================================================== --- pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/sconscript (rev 0) +++ pyplusplus_dev/unittests/data/ctypes/function_ptr_as_variable/sconscript 2009-12-26 20:13:12 UTC (rev 1785) @@ -0,0 +1,7 @@ +Import('*') + +target_name = 'function_ptr_as_variable' +shlib = env.SharedLibrary( target=target_name + , source=[ target_name + '.cpp' ] + , CPPPATH=['#data'] ) +env.Alias( target_name, shlib ) Modified: pyplusplus_dev/unittests/sconstruct =================================================================== --- pyplusplus_dev/unittests/sconstruct 2009-12-26 19:21:49 UTC (rev 1784) +++ pyplusplus_dev/unittests/sconstruct 2009-12-26 20:13:12 UTC (rev 1785) @@ -32,7 +32,8 @@ , 'variables' , 'varargs' , 'templates' - , 'circular_references' ] + , 'circular_references' + , 'function_ptr_as_variable' ] for s in scripts: SConscript( 'data/ctypes/%s/sconscript' % s This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2009-12-26 19:21:59
|
Revision: 1784 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1784&view=rev Author: roman_yakovenko Date: 2009-12-26 19:21:49 +0000 (Sat, 26 Dec 2009) Log Message: ----------- fix ctypes - bit fields code generation Modified Paths: -------------- pyplusplus_dev/docs/history/history.rest pyplusplus_dev/pyplusplus/code_creators/member_variable.py pyplusplus_dev/unittests/ctypes_tester.py pyplusplus_dev/unittests/data/ctypes/variables/variables.cpp pyplusplus_dev/unittests/data/ctypes/variables/variables.h Modified: pyplusplus_dev/docs/history/history.rest =================================================================== --- pyplusplus_dev/docs/history/history.rest 2009-12-24 21:25:59 UTC (rev 1783) +++ pyplusplus_dev/docs/history/history.rest 2009-12-26 19:21:49 UTC (rev 1784) @@ -26,6 +26,7 @@ * Carsten( spom.spom ) * Pertti Kellomäki * Benoît Leveau +* Nikolaus Rath ----------- SVN Version @@ -66,6 +67,8 @@ Many thanks to Benoît Leveau. +10. Numerous bugs in "ctypes code generator" were fixed. Many thanks to Nikolaus Rath. + ----------- Version 1.0 ----------- Modified: pyplusplus_dev/pyplusplus/code_creators/member_variable.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/member_variable.py 2009-12-24 21:25:59 UTC (rev 1783) +++ pyplusplus_dev/pyplusplus/code_creators/member_variable.py 2009-12-26 19:21:49 UTC (rev 1784) @@ -735,9 +735,14 @@ vars = vars.to_list() vars.sort( key=lambda d: d.location.line ) for v in vars: - result.append( self.indent( '("%(name)s", %(type)s),' - % dict( name=v.alias - ,type=ctypes_formatter.as_ctype( v.type ) ) ) ) + tmp = None + type_as_str = ctypes_formatter.as_ctype( v.type ) + if v.bits != None: + tmp = '("%(name)s", %(type)s, %(bits)d),' \ + % dict( name=v.alias, type=type_as_str, bits=v.bits ) + else: + tmp = '("%(name)s", %(type)s),' % dict( name=v.alias, type=type_as_str ) + result.append( self.indent( tmp ) ) result.append( ']' ) return os.linesep.join( result ) Modified: pyplusplus_dev/unittests/ctypes_tester.py =================================================================== --- pyplusplus_dev/unittests/ctypes_tester.py 2009-12-24 21:25:59 UTC (rev 1783) +++ pyplusplus_dev/unittests/ctypes_tester.py 2009-12-26 19:21:49 UTC (rev 1784) @@ -151,6 +151,8 @@ self.module_ref.init() self.failUnless( self.module_ref.j.value == 87 ) self.failUnless( self.module_ref.data.i == 1900 ) + + self.failUnless( self.module_ref.data.j == 7 ) self.failUnless( self.module_ref.data_ptr.contents.i == 11 ) self.module_ref.j.value = 78 @@ -158,7 +160,13 @@ self.module_ref.data.i = 987 self.failUnless( self.module_ref.get_value_data() == 987 ) + + self.module_ref.data.j = 8 + self.failUnless( self.module_ref.get_value_data_j() == 0 ) + self.module_ref.data.j = 5 + self.failUnless( self.module_ref.get_value_data_j() == 5 ) + self.module_ref.data_ptr.contents.i = 34 self.failUnless( self.module_ref.get_value_data_p() == 34 ) Modified: pyplusplus_dev/unittests/data/ctypes/variables/variables.cpp =================================================================== --- pyplusplus_dev/unittests/data/ctypes/variables/variables.cpp 2009-12-24 21:25:59 UTC (rev 1783) +++ pyplusplus_dev/unittests/data/ctypes/variables/variables.cpp 2009-12-26 19:21:49 UTC (rev 1784) @@ -1,7 +1,8 @@ #include "variables.h" EXPORT_SYMBOL void init(){ - data.i = 1900; + data.i = 1900; + data.j = 7; data_ptr = new data_t(); data_ptr->i = 11; j = 87; @@ -18,5 +19,9 @@ EXPORT_SYMBOL int get_value_data_p(){ return data_ptr->i; } + +EXPORT_SYMBOL int get_value_data_j(){ + return data.j; +} Modified: pyplusplus_dev/unittests/data/ctypes/variables/variables.h =================================================================== --- pyplusplus_dev/unittests/data/ctypes/variables/variables.h 2009-12-24 21:25:59 UTC (rev 1783) +++ pyplusplus_dev/unittests/data/ctypes/variables/variables.h 2009-12-26 19:21:49 UTC (rev 1784) @@ -1,7 +1,8 @@ #include "libconfig.h" struct EXPORT_SYMBOL data_t{ - int i; + int i; + unsigned int j : 3; }; EXPORT_SYMBOL int j; @@ -11,6 +12,7 @@ EXPORT_SYMBOL void init(); EXPORT_SYMBOL int get_value_j(); EXPORT_SYMBOL int get_value_data(); -EXPORT_SYMBOL int get_value_data_p(); +EXPORT_SYMBOL int get_value_data_p(); +EXPORT_SYMBOL int get_value_data_j(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2009-12-24 21:26:17
|
Revision: 1783 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1783&view=rev Author: roman_yakovenko Date: 2009-12-24 21:25:59 +0000 (Thu, 24 Dec 2009) Log Message: ----------- according to MSDN(http://msdn.microsoft.com/en-us/library/s2ff0fz8%28VS.100%29.aspx) conversion constructor is a constructor that could be called with one argument - this change implements this behaviour - small bug fix Modified Paths: -------------- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py pyplusplus_dev/unittests/data/casting_to_be_exported.hpp Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2009-12-23 21:25:58 UTC (rev 1782) +++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2009-12-24 21:25:59 UTC (rev 1783) @@ -348,7 +348,7 @@ return False if self.is_copy_constructor: return False - if 1 != len( self.required_args ): + if not( len( self.arguments) and len( self.required_args ) < 2 ): return False if self.parent.find_out_member_access_type( self ) != declarations.ACCESS_TYPES.PUBLIC: return False Modified: pyplusplus_dev/unittests/data/casting_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/casting_to_be_exported.hpp 2009-12-23 21:25:58 UTC (rev 1782) +++ pyplusplus_dev/unittests/data/casting_to_be_exported.hpp 2009-12-24 21:25:59 UTC (rev 1783) @@ -9,7 +9,7 @@ namespace casting{ struct conversion_constructor_t{ - conversion_constructor_t( int a, int b=0 ) + conversion_constructor_t( int a=2, int b=0 ) : value_a( a* (-1) ), value_b( b * (-1) ) {} int value_a; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |