Skip to content

Commit

Permalink
new spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
plicease committed Jan 1, 2025
1 parent 8d52251 commit c5e8475
Show file tree
Hide file tree
Showing 27 changed files with 449 additions and 75 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ my $function = $ffi->function( $name => \@fixed_argument_types => \@var_argument
my $function = $ffi->function( $name => \@fixed_argument_types => \@var_argument_types => \&wrapper);
```

Version 0.91 and later allows you to creat functions for c variadic functions
Version 0.91 and later allows you to create functions for c variadic functions
(such as printf, scanf, etc) which can take a variable number of arguments.
The first set of arguments are the fixed set, the second set are the variable
arguments to bind with. The variable argument types must be specified in order
Expand Down Expand Up @@ -688,7 +688,7 @@ my $unittype = $ffi->unitof($type);
```

For array and pointer types, returns the basic type without the array or pointer part.
In other words, for `sin16[]` or `sint16*` it will return `sint16`.
In other words, for `sint16[]` or `sint16*` it will return `sint16`.

## find\_lib

Expand Down Expand Up @@ -1814,7 +1814,7 @@ use FFI::Platypus 2.00;
use FFI::CheckLib qw( find_lib_or_die );

# This example uses FreeBSD's libarchive to list the contents of any
# archive format that it suppors. We've also filled out a part of
# archive format that it supports. We've also filled out a part of
# the ArchiveWrite class that could be used for writing archive formats
# supported by libarchive

Expand Down Expand Up @@ -1962,7 +1962,7 @@ $ffi->attach( [ free => 'DESTROY' ] => ['archive_t'] );
The `libarchive` is a large library with hundreds of methods.
For comprehensive FFI bindings for `libarchive` see [Archive::Libarchive](https://metacpan.org/pod/Archive::Libarchive).

## unix open
## UNIX open

### C API

Expand Down Expand Up @@ -2028,7 +2028,7 @@ of `opaque` (the latter being the default for the `object` type).
Mainly just for demonstration since Perl has much better IO libraries,
but now we have an OO interface to the Unix IO functions.

## Varadic Functions (with libcurl)
## Variadic Functions (with libcurl)

### C API

Expand Down Expand Up @@ -2077,15 +2077,15 @@ $ perl curl.pl

### Discussion

The [libcurl](https://curl.se/) library makes extensive use of "varadic" functions.
The [libcurl](https://curl.se/) library makes extensive use of "variadic" functions.

The C programming language and ABI have the concept of "varadic" functions
The C programming language and ABI have the concept of "variadic" functions
that can take a variable number and variable type of arguments. Assuming
you have a `libffi` that supports it (and most modern systems should),
then you can create bindings to a varadic function by providing two sets
of array references, one for the fixed arguments (for reasons, C varadic
then you can create bindings to a variadic function by providing two sets
of array references, one for the fixed arguments (for reasons, C variadic
functions must have at least one) and one for variable arguments. In
this example we call `curl_easy_setopt` as a varadic function.
this example we call `curl_easy_setopt` as a variadic function.

For functions that have a large or infinite number of possible signatures
it may be impracticable or impossible to attach them all. You can instead
Expand Down Expand Up @@ -2167,7 +2167,7 @@ argument types and the return type.

Inside the closure or callback we use the [window function](https://metacpan.org/pod/FFI::Platypus::Buffer#window)
from [FFI::Platypus::Buffer](https://metacpan.org/pod/FFI::Platypus::Buffer) again to avoid an _extra_ copy. We still
have to copy the buffer to append it to `$hmtl` but it is at least one
have to copy the buffer to append it to `$html` but it is at least one
less copy.

## bundle your own code
Expand Down Expand Up @@ -2385,7 +2385,7 @@ in writing interfaces that use enums.
## Memory leaks

There are a couple places where memory is allocated, but never deallocated that may
look like memory leaks by tools designed to find memory leaks like valgrind. This
look like memory leaks by tools designed to find memory leaks like Valgrind. This
memory is intended to be used for the lifetime of the perl process so there normally
this isn't a problem unless you are embedding a Perl interpreter which doesn't closely
match the lifetime of your overall application.
Expand All @@ -2407,7 +2407,7 @@ for use cases where Perl and Platypus are embedded in a larger application
where the lifetime of the Perl process is significantly smaller than the
overall lifetime of the whole process.

## I get seg faults on some platforms but not others with a library using pthreads.
## I get segfaults on some platforms but not others with a library using pthreads.

On some platforms, Perl isn't linked with `libpthreads` if Perl threads are not
enabled. On some platforms this doesn't seem to matter, `libpthreads` can be
Expand Down Expand Up @@ -2463,7 +2463,7 @@ written it yet.
# SUPPORT

The intent of the `FFI-Platypus` team is to support the same versions of
Perl that are supported by the Perl toolchain. As of this writing that
Perl that are supported by the Perl Toolchain. As of this writing that
means 5.16 and better.

IRC: #native on irc.perl.org
Expand Down Expand Up @@ -2584,7 +2584,7 @@ regulations. We can always tweak things later.
- Please make an effort to follow existing coding style when making pull
requests.
- The intent of the `FFI-Platypus` team is to support the same versions of
Perl that are supported by the Perl toolchain. As of this writing that
Perl that are supported by the Perl Toolchain. As of this writing that
means 5.16 and better. As such, please do not include any code that
requires a newer version of Perl.
Expand All @@ -2605,7 +2605,7 @@ the system doesn't provide `pkg-config` and `libffi` it will attempt
to download `libffi` and build it from source. If you are including
Platypus in a larger system (for example a Linux distribution) you
only need to make sure to declare `pkg-config` or `pkgconf` and
the development package for `libffi` as prereqs for this module.
the development package for `libffi` as prerequisites for this module.
# SEE ALSO
Expand Down
1 change: 1 addition & 0 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ match = ^corpus/ffi_build_mm/project1/blib

filename = xt/author/pod_spelling_common.t
filename = xt/author/strict.t
filename = xt/author/pod_spelling_system.t

[AlienBase::Wrapper::Bundle]
:version = 0.26
Expand Down
2 changes: 1 addition & 1 deletion examples/archive.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use FFI::CheckLib ();

# This example uses FreeBSD's libarchive to list the contents of any
# archive format that it suppors. We've also filled out a part of
# archive format that it supports. We've also filled out a part of
# the ArchiveWrite class that could be used for writing archive formats
# supported by libarchive

Expand Down
2 changes: 1 addition & 1 deletion examples/archive_object.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use FFI::CheckLib qw( find_lib_or_die );

# This example uses FreeBSD's libarchive to list the contents of any
# archive format that it suppors. We've also filled out a part of
# archive format that it supports. We've also filled out a part of
# the ArchiveWrite class that could be used for writing archive formats
# supported by libarchive

Expand Down
4 changes: 2 additions & 2 deletions inc/Alien/Base/Wrapper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use Text::ParseWords qw( shellwords );
# for this [AlienBase::Wrapper::Bundle]

# ABSTRACT: Compiler and linker wrapper for Alien
our $VERSION = '2.83'; # VERSION
our $VERSION = '2.80'; # VERSION


sub _join
Expand Down Expand Up @@ -325,7 +325,7 @@ Alien::Base::Wrapper - Compiler and linker wrapper for Alien
=head1 VERSION
version 2.83
version 2.80
=head1 SYNOPSIS
Expand Down
6 changes: 4 additions & 2 deletions lib/FFI/Build.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ use File::Path ();
# Hey Man!
# There Goes The Platypus-Man

=for stopwords postlink ARGS
=head1 SYNOPSIS
use FFI::Platypus 2.00;
Expand All @@ -39,7 +41,7 @@ use File::Path ();
my $lib = $build->build;
my $ffi = FFI::Platypus->new( api => 2 );
# The filename will be platform dependant, but something like libfrooble.so or frooble.dll
# The filename will be platform dependent, but something like libfrooble.so or frooble.dll
$ffi->lib($lib->path);
... # use $ffi to attach functions in ffi/*.c
Expand Down Expand Up @@ -347,7 +349,7 @@ sub _file_classes
}

# also anything already loaded, that might not be in the
# @INC path (for testing ususally)
# @INC path (for testing usually)
push @file_classes,
map { my $f = $_; $f =~ s/::$//; "FFI::Build::File::$f" }
grep !/Base::/,
Expand Down
2 changes: 1 addition & 1 deletion lib/FFI/Build/File/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Use it:
my $file = FFI::Build::File::Foo->new('src/myfile.foo');
# generate a temp file with provided content
# file will be deletd when $file falls out of scope.
# file will be deleted when $file falls out of scope.
my $file = FFI::Build::File::Foo->new(\'content for a temp foo');
Expand Down
8 changes: 5 additions & 3 deletions lib/FFI/Build/Platform.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use FFI::Platypus::ShareConfig;
# ABSTRACT: Platform specific configuration.
# VERSION

=for stopwords shellwords shellworded Wl
=head1 SYNOPSIS
use FFI::Build::Platform;
Expand Down Expand Up @@ -76,7 +78,7 @@ be used.
my $osname = $platform->osname;
The "os name" as understood by Perl. This is the same as C<$^O>.
The Operating System's name as understood by Perl. This is the same as C<$^O>.
=cut

Expand Down Expand Up @@ -219,7 +221,7 @@ sub cxx
return \@maybe if $self->which($maybe[0]);
}

# TODO: there are probably situations, eg solaris
# TODO: there are probably situations, example: Solaris
# where we don't want to try c++ in the case of
# a ccname = gcc ?
my @maybe = qw( c++ g++ clang++ );
Expand Down Expand Up @@ -253,7 +255,7 @@ sub cxxld
$DB::single = 1;

# This is definitely not exhaustive or complete or even
# particularlly good. Patches welcome.
# particularly good. Patches welcome.

if($self->osname eq 'darwin')
{
Expand Down
40 changes: 20 additions & 20 deletions lib/FFI/Platypus.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ use FFI::Platypus::Type;
# From the original FFI::Platypus prototype:
# Kinda like gluing a duckbill to an adorable mammal

=begin stopwords
=encoding UTF-8
ØMQ
=end stopwords
=for stopwords ØMQ centric html abi abis XORd HHGG Rubinius CURLOPT
=head1 SYNOPSIS
Expand Down Expand Up @@ -727,7 +725,7 @@ Examples:
my $function = $ffi->function( $name => \@fixed_argument_types => \@var_argument_types);
my $function = $ffi->function( $name => \@fixed_argument_types => \@var_argument_types => \&wrapper);
Version 0.91 and later allows you to creat functions for c variadic functions
Version 0.91 and later allows you to create functions for c variadic functions
(such as printf, scanf, etc) which can take a variable number of arguments.
The first set of arguments are the fixed set, the second set are the variable
arguments to bind with. The variable argument types must be specified in order
Expand Down Expand Up @@ -767,7 +765,7 @@ sub function
$ret = 'void' unless defined $ret;

# special case: treat a single void argument type as an empty list of
# arguments, a la olde timey C compilers.
# arguments, a la old-timey C compilers.
if( (!defined $var_args) && @$fixed_args == 1 && $fixed_args->[0] eq 'void' )
{
$fixed_args = [];
Expand Down Expand Up @@ -1121,7 +1119,7 @@ sub def
my $unittype = $ffi->unitof($type);
For array and pointer types, returns the basic type without the array or pointer part.
In other words, for C<sin16[]> or C<sint16*> it will return C<sint16>.
In other words, for C<sint16[]> or C<sint16*> it will return C<sint16>.
=cut

Expand Down Expand Up @@ -1908,7 +1906,7 @@ one function with:
The C<libarchive> is a large library with hundreds of methods.
For comprehensive FFI bindings for C<libarchive> see L<Archive::Libarchive>.
=head2 unix open
=head2 UNIX open
=head3 C API
Expand All @@ -1932,7 +1930,7 @@ of C<opaque> (the latter being the default for the C<object> type).
Mainly just for demonstration since Perl has much better IO libraries,
but now we have an OO interface to the Unix IO functions.
=head2 Varadic Functions (with libcurl)
=head2 Variadic Functions (with libcurl)
=head3 C API
Expand Down Expand Up @@ -1966,15 +1964,15 @@ but now we have an OO interface to the Unix IO functions.
=head3 Discussion
The L<libcurl|https://curl.se/> library makes extensive use of "varadic" functions.
The L<libcurl|https://curl.se/> library makes extensive use of "variadic" functions.
The C programming language and ABI have the concept of "varadic" functions
The C programming language and ABI have the concept of "variadic" functions
that can take a variable number and variable type of arguments. Assuming
you have a C<libffi> that supports it (and most modern systems should),
then you can create bindings to a varadic function by providing two sets
of array references, one for the fixed arguments (for reasons, C varadic
then you can create bindings to a variadic function by providing two sets
of array references, one for the fixed arguments (for reasons, C variadic
functions must have at least one) and one for variable arguments. In
this example we call C<curl_easy_setopt> as a varadic function.
this example we call C<curl_easy_setopt> as a variadic function.
For functions that have a large or infinite number of possible signatures
it may be impracticable or impossible to attach them all. You can instead
Expand Down Expand Up @@ -2024,7 +2022,7 @@ argument types and the return type.
Inside the closure or callback we use the L<window function|FFI::Platypus::Buffer/window>
from L<FFI::Platypus::Buffer> again to avoid an I<extra> copy. We still
have to copy the buffer to append it to C<$hmtl> but it is at least one
have to copy the buffer to append it to C<$html> but it is at least one
less copy.
=head2 bundle your own code
Expand Down Expand Up @@ -2150,7 +2148,7 @@ in writing interfaces that use enums.
=head2 Memory leaks
There are a couple places where memory is allocated, but never deallocated that may
look like memory leaks by tools designed to find memory leaks like valgrind. This
look like memory leaks by tools designed to find memory leaks like Valgrind. This
memory is intended to be used for the lifetime of the perl process so there normally
this isn't a problem unless you are embedding a Perl interpreter which doesn't closely
match the lifetime of your overall application.
Expand All @@ -2176,7 +2174,7 @@ for use cases where Perl and Platypus are embedded in a larger application
where the lifetime of the Perl process is significantly smaller than the
overall lifetime of the whole process.
=head2 I get seg faults on some platforms but not others with a library using pthreads.
=head2 I get segfaults on some platforms but not others with a library using pthreads.
On some platforms, Perl isn't linked with C<libpthreads> if Perl threads are not
enabled. On some platforms this doesn't seem to matter, C<libpthreads> can be
Expand Down Expand Up @@ -2236,7 +2234,7 @@ written it yet.
=head1 SUPPORT
The intent of the C<FFI-Platypus> team is to support the same versions of
Perl that are supported by the Perl toolchain. As of this writing that
Perl that are supported by the Perl Toolchain. As of this writing that
means 5.16 and better.
IRC: #native on irc.perl.org
Expand Down Expand Up @@ -2363,7 +2361,7 @@ requests.
=item
The intent of the C<FFI-Platypus> team is to support the same versions of
Perl that are supported by the Perl toolchain. As of this writing that
Perl that are supported by the Perl Toolchain. As of this writing that
means 5.16 and better. As such, please do not include any code that
requires a newer version of Perl.
Expand All @@ -2390,7 +2388,7 @@ the system doesn't provide C<pkg-config> and C<libffi> it will attempt
to download C<libffi> and build it from source. If you are including
Platypus in a larger system (for example a Linux distribution) you
only need to make sure to declare C<pkg-config> or C<pkgconf> and
the development package for C<libffi> as prereqs for this module.
the development package for C<libffi> as prerequisites for this module.
=head1 SEE ALSO
Expand Down Expand Up @@ -2553,6 +2551,8 @@ Provides libffi for Platypus during its configuration and build stages.
=back
=for stopwords Grinnz Ghedini MHOWARD Alessandro AWWAIID ALEXBIO
=head1 ACKNOWLEDGMENTS
In addition to the contributors mentioned below, I would like to
Expand Down
Loading

0 comments on commit c5e8475

Please sign in to comment.