...
 
Commits (13)
executable('dbus-client-example', 'client_bus_listnames.cc', dependencies : giomm_dep)
executable('dbus-server-no-bus-example', 'server_without_bus.cc', dependencies : giomm_dep)
executable('dbus-server-example', 'session_bus_service.cc', dependencies : giomm_dep)
\ No newline at end of file
executable('iochannel_stream-example', 'main.cc', 'fdstream.cc', dependencies : giomm_dep)
#TODO: this could be moved to simple-examples
executable('markup-example', 'parser.cc', dependencies : giomm_dep)
simple_examples = [
'child_watch',
'compose',
'keyfile',
'options',
'regex']
foreach example : simple_examples
executable(example + '-example', join_paths(example, 'main.cc'), dependencies : giomm_dep)
endforeach
subdir('dbus')
subdir('iochannel_stream')
subdir('markup')
subdir('network')
subdir('properties')
subdir('settings')
subdir('thread')
executable('network-client-example', 'socket-client.cc', dependencies : giomm_dep)
executable('network-server-example', 'socket-server.cc', dependencies : giomm_dep)
executable('network-resolver-example',
'resolver.cc',
dependencies : giomm_dep,
include_directories: config_inc_dir)
#TODO: this could be moved to simple-examples
executable('properties-example', 'properties_example.cc', dependencies : glibmm_dep)
gnome = import('gnome')
gnome.compile_schemas()
executable('settings-example', 'settings.cc', dependencies : giomm_dep)
executable('thread-1-example', 'dispatcher.cc', dependencies : glibmm_dep)
executable('thread-2-example', 'dispatcher2.cc', dependencies : glibmm_dep)
giodep = dependency('gio-2.0')
giounixdep = dependency('gio-unix-2.0')
giomm_modules = [
'actiongroup',
'dbusproxy',
'memoryinputstream',
'socketaddress',
'action',
'dbusserver',
'memoryoutputstream',
'socketclient',
'actionmap',
'dbussubtreevtable',
'menuattributeiter',
'socketconnectable',
'appinfo',
'dbusutils',
'menu',
'socketconnection',
'applaunchcontext',
'dbuswatchname',
'menuitem',
'socketcontrolmessage',
'applicationcommandline',
'desktopappinfo',
'menulinkiter',
'socket',
'application',
'drive',
'menumodel',
'socketlistener',
'asyncinitable',
'emblemedicon',
'mount',
'socketservice',
'asyncresult',
'emblem',
'mountoperation',
'srvtarget',
'bufferedinputstream',
'enums',
'networkaddress',
'tcpconnection',
'bufferedoutputstream',
'error',
'networkmonitor',
'tcpwrapperconnection',
'cancellable',
'fileattributeinfo',
'networkservice',
'themedicon',
'charsetconverter',
'fileattributeinfolist',
'notification',
'threadedsocketservice',
'converter',
'filedescriptorbased',
'outputstream',
'tlscertificate',
'converterinputstream',
'fileenumerator',
'permission',
'tlsclientconnection',
'converteroutputstream',
'file',
'pollableinputstream',
'tlsconnection',
'credentials',
'fileicon',
'pollableoutputstream',
'tlsdatabase',
'datainputstream',
'fileinfo',
'propertyaction',
'tlsfiledatabase',
'dataoutputstream',
'fileinputstream',
'proxyaddress',
'tlsinteraction',
'dbusactiongroup',
'fileiostream',
'proxy',
'tlspassword',
'dbusaddress',
'filemonitor',
'proxyresolver',
'tlsserverconnection',
'dbusauthobserver',
'filenamecompleter',
'remoteactiongroup',
'unixconnection',
'dbusconnection',
'fileoutputstream',
'resolver',
'unixcredentialsmessage',
'dbuserror',
'filterinputstream',
'resource',
'unixfdlist',
'dbuserrorutils',
'filteroutputstream',
'seekable',
'unixfdmessage',
'dbusinterface',
'icon',
'settings',
'unixinputstream',
'dbusinterfaceskeleton',
'inetaddress',
'settingsschema',
'dbusinterfacevtable',
'inetsocketaddress',
'settingsschemakey',
'unixoutputstream',
'dbusintrospection',
'initable',
'settingsschemasource',
'unixsocketaddress',
'dbusmenumodel',
'inputstream',
'simpleactiongroup',
'volume',
'dbusmessage',
'iostream',
'simpleaction',
'volumemonitor',
'dbusmethodinvocation',
'listmodel',
'simpleiostream',
'zlibcompressor',
'dbusobject',
'liststore',
'simplepermission',
'zlibdecompressor',
'dbusownname',
'loadableicon',
'socketaddressenumerator']
giomm_handwritten_sources = [
'contenttype.cc',
'init.cc',
'slot_async.cc',
'socketsource.cc']
giomm_targets = []
#TODO ugly hack, has to be implemented in other way in the future
private_dir = join_paths(meson.build_root(), 'gio', 'giomm', 'private')
giomm_targets += custom_target('giomm_generate_priv_dir',
output : 'private',
command : [python, '-c',
'import os\nos.makedirs("' + private_dir + '", exist_ok=True)'])
giomm_hg_files = []
foreach module : giomm_modules
giomm_hg_files += [join_paths(meson.current_source_dir(), '..', 'src', module + '.hg')]
endforeach
giomm_targets += custom_target('giomm_generate_wrap_init',
input : glibmm_hg_files,
output : 'wrap_init.cc',
command : [python,
wrap_output,
perl,
join_paths(meson.current_build_dir(), 'wrap_init.cc'),
'--',
join_paths(meson.build_root(), 'tools', 'generate_wrap_init.pl'),
'--namespace=Gio', '--parent_dir=giomm'] + giomm_hg_files)
# TODO: foreach below could be replaced with simpler code (see glibmm's meson file)
foreach giomm_module : giomm_modules
giomm_targets += custom_target('giomm_generate_cc_' + giomm_module,
output : [giomm_module + '.cc', giomm_module + '.h'],
input : join_paths('..', 'src', giomm_module + '.hg'),
command : [perl,
'-I../tools/pm', '--', join_paths(meson.build_root(), 'tools', 'gmmproc'),
'-I', join_paths(meson.source_root(), 'tools', 'm4'),
'--defs', join_paths(meson.current_source_dir(), '..', 'src'),
giomm_module,
join_paths(meson.current_source_dir(), '..', 'src'),
join_paths('gio', 'giomm')])
endforeach
giomm_includes = include_directories('..')
giomm_deps = [glibmm_dep, giounixdep, giodep]
giomm_library = shared_library(
'giomm',
giomm_targets, giomm_handwritten_sources,
include_directories : giomm_includes,
dependencies : giomm_deps)
giomm_dep = declare_dependency(
link_with : giomm_library,
include_directories : include_directories('..'),
dependencies : giomm_deps)
configure_file(output : 'giommconfig.h',
configuration : conf)
subdir('giomm')
glibmm_modules = [
'balancedtree',
'binding',
'bytes',
'bytearray',
'checksum',
'convert',
'date',
'datetime',
'enums',
'fileutils',
'iochannel',
'keyfile',
'markup',
'miscutils',
'module',
'nodetree',
'optioncontext',
'optionentry',
'optiongroup',
'regex',
'shell',
'spawn',
'timezone',
'unicode',
'uriutils',
'variant',
'variantdict',
'variantiter',
'varianttype']
glibmm_handwritten_sources = [
'base64.cc',
'class.cc',
'debug.cc',
'dispatcher.cc',
'error.cc',
'exception.cc',
'exceptionhandler.cc',
'init.cc',
'interface.cc',
'main.cc',
'object.cc',
'objectbase.cc',
'pattern.cc',
'property.cc',
'propertyproxy.cc',
'propertyproxy_base.cc',
'quark.cc',
'random.cc',
'signalproxy.cc',
'signalproxy_connectionnode.cc',
'stringutils.cc',
'timer.cc',
'timeval.cc',
'ustring.cc',
'utility.cc',
'value.cc',
'value_custom.cc',
'vectorutils.cc',
'wrap.cc']
glibmm_m4_files = [
'value_basictypes.cc',
'value_basictypes.h',
'variant_basictypes.cc',
'variant_basictypes.h']
glibmm_targets = []
#TODO ugly hack, has to be implemented in other way in the future
private_dir = join_paths(meson.build_root(), 'glib', 'glibmm', 'private')
glibmm_targets += custom_target('glibmm_generate_priv_dir',
output : 'private',
command : [python, '-c',
'import os\nos.makedirs("' + private_dir + '", exist_ok=True)'])
glibmm_hg_files = []
foreach module : glibmm_modules
glibmm_hg_files += [join_paths(meson.current_source_dir(), '..', 'src', module + '.hg')]
endforeach
glibmm_targets += custom_target('glibmm_generate_wrap_init',
input : glibmm_hg_files,
output : 'wrap_init.cc',
command : [python,
wrap_output,
perl,
join_paths(meson.current_build_dir(), 'wrap_init.cc'),
'--',
join_paths(meson.build_root(), 'tools', 'generate_wrap_init.pl'),
'--namespace=Glib', '--parent_dir=glibmm'] + glibmm_hg_files)
foreach glibmm_module : glibmm_modules
glibmm_targets += custom_target('glibmm_generate_cc_' + glibmm_module,
output : [glibmm_module + '.cc', glibmm_module + '.h'],
input : join_paths('..', 'src', glibmm_module + '.hg'),
command : [perl,
'-I../tools/pm', '--', join_paths(meson.build_root(), 'tools', 'gmmproc'),
'-I', join_paths(meson.source_root(), 'tools', 'm4'),
'--defs', join_paths(meson.current_source_dir(), '..', 'src'),
glibmm_module,
join_paths(meson.current_source_dir(), '..', 'src'),
join_paths('glib', 'glibmm')])
endforeach
# TODO: foreach above could be replaced with the following code in the future:
# TODO: we should be able to move generated files to user-specified directory
#source_gen = generator(perl,
# output : ['@BASENAME@.cc', '@BASENAME@.h'],
# input : '@BASENAME@.ccg',
# arguments : ['-I../tools/pm', '--', 'gmmproc', '-I', '../tools/m4', '--defs', '../glib/src', '@INPUT@', '../glib/src', '@BUILD_DIR@'])
#gen_sources = source_gen.process(glibmm_files_any_hg)
#glibmm = shared_library('glibmm', gen_sources,
# include_directories : glibmm_inc, dependencies : [glibdep, gmoduledep, sigcppdep])
foreach m4_file : glibmm_m4_files
glibmm_targets += custom_target('generate_from_m4' + m4_file,
output : m4_file,
input : join_paths('..', 'src', m4_file + '.m4'),
command : [python,
wrap_output,
m4,
join_paths(meson.build_root(), '@OUTPUT@'),
'@INPUT@',
'-I' + join_paths(meson.source_root(), 'glib', 'src')])
endforeach
glibmm_includes = include_directories('..')
glibmm_deps = [glibdep, sigcppdep, gobjectdep, gmoduledep]
glibmm_library = shared_library(
'glibmm',
glibmm_targets, glibmm_handwritten_sources,
include_directories : glibmm_includes,
dependencies : glibmm_deps)
glibmm_dep = declare_dependency(
link_with : glibmm_library,
include_directories : include_directories('..'),
dependencies : glibmm_deps)
......@@ -233,11 +233,11 @@ struct TypeTraits<Glib::RefPtr<const T>>
} // namespace Container_Helpers
template <class T, class PtrT>
template <class PtrT>
inline PtrT
Value_Pointer<T, PtrT>::get_(Glib::Object*) const
Value_Pointer<PtrT>::get_(Glib::Object*) const
{
return dynamic_cast<T*>(get_object());
return dynamic_cast<T>(get_object());
}
/** Partial specialization for RefPtr<> to Glib::Object.
......
configure_file(output : 'glibmmconfig.h',
configuration : conf)
subdir('glibmm')
......@@ -32,6 +32,7 @@ _WRAP_ENUM(FormatSizeFlags, GFormatSizeFlags, NO_GTYPE)
/** Gets a human-readable name for the application,
* as set by Glib::set_application_name().
*
* This name should be localized if possible, and is intended for display to
* the user. Contrast with Glib::get_prgname(), which gets a non-localized
* name. If Glib::set_application_name() has not been called, returns the
......@@ -58,9 +59,14 @@ Glib::ustring get_application_name();
void set_application_name(const Glib::ustring& application_name);
/** Gets the name of the program.
*
* This name should not be localized, in contrast to get_application_name().
*
* If you are using GDK or GTK+ the program name is set in <tt>gdk_init()</tt>,
* which is called by <tt>gtk_init()</tt>. The program name is found by taking
* the last component of <tt>argv[0]</tt>.
* which is called by <tt>gtk_init()</tt> and therefore by the constructors of
* Gtk::Main and Gtk::Application. The program name is found by taking the last
* component of <tt>argv[0]</tt>.
*
* @return The name of the program.
*/
std::string get_prgname();
......@@ -137,13 +143,24 @@ void unsetenv(const std::string& variable);
std::vector<std::string> listenv();
/** Gets the user name of the current user.
*
* The encoding of the returned string is system-defined. On UNIX, it might be
* the preferred file name encoding, or something else, and there is no
* guarantee that it is ever consistent on a machine. On Windows, it is always
* UTF-8.
*
* @return The name of the current user.
*/
std::string get_user_name();
/** Gets the real name of the user.
* This usually comes from the user's entry in the <tt>passwd</tt> file.
* @return The user's real name.
/** Gets the real name of the current user.
*
* This usually comes from the user's entry in the <tt>passwd</tt> file. The
* encoding of the returned string is subject to the same variability as noted
* for get_user_name(). If the real user name cannot be determined, the string
* "Unknown" is returned.
*
* @return The current user's real name.
*/
std::string get_real_name();
......
project('glibmm', 'cpp',
license: 'LGPL',
version: '2.53.2',
meson_version: '>= 0.40.1',
default_options: [
'c_std=gnu14',
'cpp_std=c++14',
'warning_level=1',
],
)
glibdep = dependency('glib-2.0')
gmoduledep = dependency('gmodule-2.0')
gobjectdep = dependency('gobject-2.0')
sigcppdep = dependency('sigc++-3.0')
python = import('python3').find_python()
perl = find_program('perl')
m4 = find_program('m4')
wrap_output = join_paths(meson.source_root(), 'tools', 'wrap_output.py')
version_arr = meson.project_version().split('.')
glibmm_version_major = version_arr[0].to_int()
glibmm_version_minor = version_arr[1].to_int()
glibmm_version_micro = version_arr[2].to_int()
compiler = meson.get_compiler('cpp')
conf = configuration_data()
conf.set('GLIBMM_MAJOR_VERSION', glibmm_version_major)
conf.set('GLIBMM_MINOR_VERSION', glibmm_version_minor)
conf.set('GLIBMM_MICRO_VERSION', glibmm_version_micro)
conf.set('GIOMM_MAJOR_VERSION', glibmm_version_major)
conf.set('GIOMM_MINOR_VERSION', glibmm_version_minor)
conf.set('GIOMM_MICRO_VERSION', glibmm_version_micro)
conf.set('GLIBMM_DISABLE_DEPRECATED', get_option('disable-deprecated-api'))
conf.set('GIOMM_DISABLE_DEPRECATED', get_option('disable-deprecated-api'))
conf.set('SIZEOF_WCHAR_T', compiler.sizeof('wchar_t'))
member_function_member_template_src = '''struct foo
{
template <class C> inline void doit();
void thebug();
};
template <class C>
inline void foo::doit()
{}
struct bar
{
void neitherabug();
};
void bar::neitherabug()
{
void (foo::*func)();
func = &foo::doit<int>;
(void)func;
}
void foo::thebug()
{
void (foo::*func)();
func = &foo::doit<int>; // the compiler bugs usually show here
(void)func;
}
int main() {
void (foo::*func)();
func = &foo::doit<int>;
(void)func;
return 0;
}
'''
if compiler.compiles(member_function_member_template_src)
conf.set('GLIBMM_MEMBER_FUNCTIONS_MEMBER_TEMPLATES', 1)
endif
have_disambiguous_const_template_specializations_src = '''
template <class T> class Foo {};
template <class T> class Traits
{
public:
const char* whoami() { return "generic template"; }
};
template <class T> class Traits< Foo<T> >
{
public:
const char* whoami() { return "partial specialization for Foo<T>"; }
};
template <class T> class Traits< Foo<const T> >
{
public:
const char* whoami() { return "partial specialization for Foo<const T>"; }
};
int main() {
Traits<int> it;
Traits< Foo<int> > fit;
Traits< Foo<const int> > cfit;
(void) it.whoami();
(void) fit.whoami();
(void) cfit.whoami();
return 0;
}
'''
if compiler.compiles(have_disambiguous_const_template_specializations_src)
conf.set('GLIBMM_HAVE_DISAMBIGUOUS_CONST_TEMPLATE_SPECIALIZATIONS', 1)
endif
can_use_dynamic_cast_in_unused_template_without_definition_src = '''
class SomeClass;
SomeClass* some_function();
template <class T>
class SomeTemplate
{
static bool do_something()
{
// This does not compile with the MipsPro (IRIX) compiler
// even if we don't use this template at all.
return (dynamic_cast<T*>(some_function()) != 0);
}
};
'''
if compiler.compiles(can_use_dynamic_cast_in_unused_template_without_definition_src)
conf.set('GLIBMM_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION', 1)
endif
if compiler.has_type('std::wostringstream', prefix : '#include<sstream>')
conf.set('GLIBMM_HAVE_WIDE_STREAM', 1)
endif
conf.set('GLIBMM_API', '')
conf.set('M4', 'm4')
configure_file(output : 'config.h',
configuration : conf)
config_inc_dir = include_directories('.')
add_project_arguments(language: 'cpp')
subdir('tools')
subdir('glib')
subdir('gio')
subdir('examples')
subdir('tests')
option('disable-deprecated-api', type : 'boolean', value : true)
glibmm_tests = [
'glibmm_mainloop',
'glibmm_nodetree',
'glibmm_null_vectorutils',
'glibmm_object',
'glibmm_objectbase',
'glibmm_objectbase_move',
'glibmm_object_move',
'glibmm_refptr',
'glibmm_base64',
'glibmm_refptr_sigc_bind',
'glibmm_bool_vector',
'glibmm_ustring_compose',
'glibmm_btree',
'glibmm_ustring_format',
'glibmm_buildfilename',
'glibmm_ustring_make_valid',
'glibmm_bytearray',
'glibmm_value',
'glibmm_date',
'glibmm_variant',
'glibmm_interface_implementation',
'glibmm_vector',
'glibmm_interface_move']
giomm_tests = [
'giomm_asyncresult_sourceobject',
'giomm_ioerror',
'giomm_ioerror_and_iodbuserror',
'giomm_listmodel',
'giomm_memoryinputstream',
'giomm_simple',
'giomm_stream_vfuncs',
'giomm_tls_client']
all_tests = glibmm_tests + giomm_tests
foreach test_name : all_tests
test_exec = executable('test-' + test_name, join_paths(test_name, 'main.cc'), dependencies : giomm_dep)
test(test_name, test_exec)
endforeach
\ No newline at end of file
configure_file(
input : 'gmmproc.in',
output : 'gmmproc',
configuration : conf)
configure_file(
input : 'generate_wrap_init.pl.in',
output : 'generate_wrap_init.pl',
configuration : conf)
......@@ -104,12 +104,11 @@ sub new($$)
}
elsif ($line =~ /^([^()]+)\s+(\S+)\s*\((.*)\)\s*(const)*$/)
{
no warnings qw(uninitialized); # disable the uninitialize warning for $4
$$self{rettype} = $1;
$$self{name} = $2;
$$self{c_name} = $2;
$self->parse_param($3);
$$self{const} = ($4 eq "const");
$$self{const} = defined($4);
}
else
{
......@@ -158,7 +157,7 @@ sub new_ctor($$)
if ($line =~ /^(\S+)\s*\((.*)\)\s*/)
{
$$self{name} = $1;
$$self{c_name} = $2;
$$self{c_name} = $1;
$self->parse_param($2);
}
else
......@@ -211,60 +210,73 @@ sub parse_param($$)
$line =~ s/\s+/ /g; # Compress whitespace.
return if ($line =~ /^$/);
# parse through argument list
# Add a ',' at the end. No special treatment of the last parameter is necessary,
# if it's followed by a comma, like the other parameters.
$line .= ',' if (substr($line, -1) ne ',');
# Parse through the argument list.
#
# We must find commas (,) that separate parameters, and equal signs (=) that
# separate parameter names from optional default values.
# '&', '*' and '>' are delimiters in split() because they must be separated
# from the parameter name even if there is no space char between.
# Commas within "<.,.>" or "{.,.}" or "(.,.)" do not end a parameter.
# This parsing is not guaranteed to work well if there are several levels
# of (()) or {{}}. X<Y<Z>> works in the normal case where there is nothing
# but possibly spaces between the multiple ">>".
# Quoted strings are not detected. If a quoted string exists in a function
# prototype, it's probably as part of a default value, inside ("x") or {"y"}.
#
my @str = ();
my $par = 0;
foreach (split(/(const )|([,=&*()])|({.*?})|(<[^,]*?>)|(\s+)/, $line)) #special characters OR <something> OR whitespace.
foreach (split(/(\bconst\b|[,=&*>]|<.*?>|{.*?}|\(.*?\)|\s+)/, $line))
{
next if ( !defined($_) or $_ eq "" );
if ( $_ eq "(" ) #Detect the opening bracket.
{
push(@str, $_);
$par++; #Increment the number of parameters.
next;
}
elsif ( $_ eq ")" )
if ($_ =~ /^(?:const|[*&>]|<.*>|\(.*\)|\s+)$/)
{
push(@str, $_);
$par--; #Decrement the number of parameters.
next;
# Any separator, except ',' or '=' or {.*}.
push(@str, $_);
next;
}
elsif( $_ =~ /{(.*)}/)
elsif ($_ =~ /^{(.*)}$/)
{
# gmmproc options have been specified for the current parameter so
# process them.
# Get the options.
my $options = $1;
# Check if param should be optional or an output param.
$flags = FLAG_PARAM_OPTIONAL if($options =~ /\?/);
$flags |= FLAG_PARAM_OUTPUT if($options =~ />>/);
# Delete "NULL" from $options, so it won't be interpreted as a parameter name.
if ($options =~ s/(!?\bNULL\b)//)
if (!$has_value)
{
$flags |= ($1 eq "!NULL") ? FLAG_PARAM_EMPTY_STRING : FLAG_PARAM_NULLPTR;
# gmmproc options have been specified for the current parameter so
# process them.
# Get the options.
my $options = $1;
# Check if param should be optional or an output param.
$flags = FLAG_PARAM_OPTIONAL if($options =~ /\?/);
$flags |= FLAG_PARAM_OUTPUT if($options =~ />>/);
# Delete "NULL" from $options, so it won't be interpreted as a parameter name.
if ($options =~ s/(!?\bNULL\b)//)
{
$flags |= ($1 eq "!NULL") ? FLAG_PARAM_EMPTY_STRING : FLAG_PARAM_NULLPTR;
}
# Check if it should be mapped to a C param.
if ($options =~ /(\w+|\.)/)
{
$mapping = $1;
$mapping = $name if($mapping eq ".");
}
}
# Check if it should be mapped to a C param.
if ($options =~ /(\w+|\.)/)
else
{
$mapping = $1;
$mapping = $name if($mapping eq ".");
# {...} in a default value.
push(@str, $_);
}
next;
}
elsif ( $par || /^(const )|(<[^,]*>)|([*&>])|(\s+)/ ) #TODO: What's happening here?
{
push(@str, $_); #This looks like part of the type, so we store it.
next;
}
elsif ( $_ eq "=" ) #Default value
{
$str[$name_pos] = "" if ($name_pos >= 0);
$type = join("", @str); #The type is everything before the = character.
# The type is everything before the = character, except the parameter name.
$type = join("", @str);
@str = (); #Wipe it so that it will only contain the default value, which comes next.
$has_value = 1;
next;
......@@ -310,54 +322,26 @@ sub parse_param($$)
$mapping = "";
$id = 0;
next;
}
if ($has_value)
{
push(@str, $_);
next;
}
# The last identifier before ',', '=', or '{.*}' is the parameter name.
# E.g. int name, unsigned long int name = 42, const unsigned int& name.
# The name must be preceded by at least one other identifier (the type).
# 'const ' is treated specially, as it can't by itself denote the type.
$id++;
# Anything but a separator in split().
push(@str, $_);
if ($id >= 2)
if (!$has_value)
{
$name = $_;
$name_pos = $#str;
# The last identifier before ',', '=', or '{.*}' is the parameter name.
# E.g. int name, unsigned long int name = 42, const unsigned int& name.
# The name must be preceded by at least one other identifier (the type).
# 'const' is treated specially, as it can't by itself denote the type.
$id++;
if ($id >= 2)
{
$name = $_;
$name_pos = $#str;
}
}
}
# handle last argument (There's no , at the end.)
if ($has_value)
{
$value = join("", @str);
}
else
{
$str[$name_pos] = "" if ($name_pos >= 0);
$type = join("", @str);
}
if ($name eq "")
{
$name = sprintf("p%s", $#$param_types + 2)
}
$type = string_trim($type);
push(@$param_types, $type);
push(@$param_names, $name);
push(@$param_default_values, $value);
push(@$param_flags, $flags);
# Map from the c_name to the C++ index (no map if no name given).
$$param_mappings{$mapping} = $curr_param if($mapping);
} # end foreach
}
# add_parameter_autoname($, $type, $name)
......
......@@ -709,7 +709,6 @@ sub string_split_commas($)
my @out;
my $level = 0;
my $in_braces = 0;
my $in_quotes = 0;
my $str = "";
my @in = split(/([,"()<>{}])/, $in);
......@@ -723,15 +722,12 @@ sub string_split_commas($)
$in_quotes = !$in_quotes if ($t eq '"');
if (!$in_quotes)
{
$in_braces++ if ($t eq "{");
$in_braces-- if ($t eq "}");
$level++ if ($t eq "(" or $t eq "<" or $t eq "{");
$level++ if ($t eq "(" or $t eq "<");
# In the case of a '>' decrease the level if it is not in a {...}
# because if it is found in a {...} it is most likely indicating that
# a parameter in a method declaration is an output param.
$level-- if ($t eq ")" or ($t eq ">" && !$in_braces));
# In the case of a '>' decrease the level if it is not in a {...} without
# a preceding '<', because then it is most likely indicating that
# a parameter in a method declaration is an output parameter (name{>>}).
$level-- if ($t eq ")" or $t eq "}" or ($t eq ">" && $str !~ /{[^<}]*$/));
# Don't split at comma, if inside a function, e.g. void f1(int x, int y)
# or std::map<Glib::ustring, float> f2(),
......
from subprocess import call
import sys
f = open(sys.argv[2], "w")
call_args = [sys.argv[1]] + sys.argv[3:]
call(call_args, stdout = f)