Skip to content
New issue

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

Documentation issue #42

Open
KES777 opened this issue Dec 25, 2020 · 4 comments
Open

Documentation issue #42

KES777 opened this issue Dec 25, 2020 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@KES777
Copy link

KES777 commented Dec 25, 2020

https://metacpan.org/pod/FFI::C::Struct

This is ambiguous. Synopsis describe FFI::C::StructDef, methods do same.

What is FFI::C::Struct?

@KES777
Copy link
Author

KES777 commented Dec 25, 2020

Here: https://metacpan.org/pod/FFI::C::StructDef#trim_string1

I do not work with C so do not understand what is fixed-length strings and how they trimmed.
Would be nice to see usecase

@KES777
Copy link
Author

KES777 commented Dec 25, 2020

Here: https://metacpan.org/pod/FFI::C::Struct

At other module's synopsis you use bundle and pass parameter $ffi here is missed. This is unclear why here it is missed and what is the difference

Here I found that we may pass or miss this parameter. This is unclear which one will be created. And unclear the difference

@plicease plicease added the documentation Improvements or additions to documentation label Dec 25, 2020
@KES777
Copy link
Author

KES777 commented Dec 25, 2020

Here an example could be improved:

my $definition =  FFI::C::StructDef->new( class => 'User::Struct::Class', ... );
my $instance = $definition->new; 
my $instance = User::Struct::Class->new; # same

@KES777
Copy link
Author

KES777 commented Dec 25, 2020

Did not find an example how to use array members.

Please, mention this here

  FFI::C::StructDef->new(
    $ffi,
    nullable =>  1,
    name     =>  'SDL_RendererInfo',
    class    =>  'SDL2::RendererInfo',
    members  =>  [
      name                =>  'string',
      flags               =>  'uint32',
      num_texture_formats =>  'uint32',
      texture_formats     =>  'uint32[16]',
      max_texture_width   =>  'int',
      max_texture_height  =>  'int',
    ],
  );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Development

No branches or pull requests

2 participants