We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
by providing a package I still want that constant is created at specified package.
It would be nice if we also specify some global space for all constants (this is useful for large libraries)
global
$ffi->load_custom_type('::Enum', 'SDL_RendererFlip', { ret => 'int', package => 'SDL2::Render', global => 'SDL2' }, ...
And when $ffi is instantiated we can pass parameter which trigger spoil global namespace or not:
$ffi
my $ffi = FFI::Platypus->new( api => 1, global => 1 ); # Enable all globals my $ffi = FFI::Platypus->new( api => 1, global => [ 'SDL2', 'SomeOtherSpace' ] ); # Enable only these two my $ffi = FFI::Platypus->new( api => 1, global => 0 ); # Constant still accessable via SDL2::Render::SDL_FLIP_NONE my $ffi = FFI::Platypus->new( api => 1 ); # Constant still accessable via SDL2::Render::SDL_FLIP_NONE
Also would be nice if it automatically remove some prefix:
$ffi->load_custom_type('::Enum', 'SDL_RendererFlip', { ret => 'int', package => 'SDL2::Render', remove => 'SDL_' }, ['SDL_FLIP_NONE' => 0x00000000], # /**< Do not flip */
will create SDL2::Render::FLIP_NONE. This will save us from repeating SDL because it is already at package name
SDL2::Render::FLIP_NONE
SDL
The text was updated successfully, but these errors were encountered:
It would be nice if we also specify some global space for all constants (this is useful for large libraries) $ffi->load_custom_type('::Enum', 'SDL_RendererFlip', { ret => 'int', package => 'SDL2::Render', global => 'SDL2' }, ...
How about package accepts an array reference in addition to just a scalar:
package
$ffi->load_custom_type('::Enum', 'SDL_RendererFlip', { ret => 'int', package => ['SDL2::Render', 'SDL2'] }, ...
And when $ffi is instantiated we can pass parameter which trigger spoil global namespace or not: my $ffi = FFI::Platypus->new( api => 1, global => 1 ); # Enable all globals my $ffi = FFI::Platypus->new( api => 1, global => [ 'SDL2', 'SomeOtherSpace' ] ); # Enable only these two my $ffi = FFI::Platypus->new( api => 1, global => 0 ); # Constant still accessable via SDL2::Render::SDL_FLIP_NONE my $ffi = FFI::Platypus->new( api => 1 ); # Constant still accessable via SDL2::Render::SDL_FLIP_NONE
I'm not quite sure how you would use this, or why you can't specify the package spaces when you load the custom type.
Also would be nice if it automatically remove some prefix: $ffi->load_custom_type('::Enum', 'SDL_RendererFlip', { ret => 'int', package => 'SDL2::Render', remove => 'SDL_' }, ['SDL_FLIP_NONE' => 0x00000000], # /**< Do not flip */ will create SDL2::Render::FLIP_NONE. This will save us from repeating SDL because it is already at package name
I'm not dogmatically apposed to this, but why can't you just specify the constant names without the prefix?
Sorry, something went wrong.
No branches or pull requests
by providing a package I still want that constant is created at specified package.
It would be nice if we also specify some
global
space for all constants (this is useful for large libraries)And when
$ffi
is instantiated we can pass parameter which trigger spoilglobal
namespace or not:Also would be nice if it automatically remove some prefix:
will create
SDL2::Render::FLIP_NONE
. This will save us from repeatingSDL
because it is already at package nameThe text was updated successfully, but these errors were encountered: