Skip to content

Commit ebc33e1

Browse files
committed
correct some typos and spellings
1 parent 0ec522f commit ebc33e1

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

doc/Language/nativecall.pod

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The simplest imaginable use of NativeCall would look something like this:
1717
The first line imports various traits and types. The next line looks like
1818
a relatively ordinary Perl 6 sub declaration - with a twist. We use the
1919
"native" trait in order to specify that the sub is actually defined in a
20-
native library. The platform-specific extension (e.g. .so or .dll) will be
20+
native library. The platform-specific extension (e.g., '.so' or '.dll') will be
2121
added for you.
2222
2323
The first time you call "some_argless_function", the "libsomething" will be
@@ -79,7 +79,7 @@ likely grow with time).
7979
size_t (size_t in C)
8080
8181
Don't use Perl 6 native types like C<int> or C<num>, as they don't have to
82-
correspond to the local C equivalent (e.g. Perl 6's C<int> can be 8 bytes but
82+
correspond to the local C equivalent (e.g., Perl 6's C<int> can be 8 bytes but
8383
C's C<int> is only 4 bytes).
8484
8585
Note that the lack of a C<returns> trait is used to indicate void return type.
@@ -178,7 +178,7 @@ Once again, type objects are used to represent nulls.
178178
=head1 Function Pointers
179179
180180
C libraries can expose pointers to C functions as return values of functions and as
181-
members of Structures like e.g. structs and unions.
181+
members of Structures like, e.g., structs and unions.
182182
183183
Example of invoking a function pointer "$fptr" returned by a function "f", using a
184184
signature defining the desired function parameters and return value:
@@ -194,7 +194,7 @@ signature defining the desired function parameters and return value:
194194
195195
NativeCall has some support for arrays. It is constrained to work with machine-size
196196
integers, doubles and strings, sized numeric types, arrays of pointers, arrays of
197-
structs and arrays of arrays.
197+
structs, and arrays of arrays.
198198
199199
Perl 6 arrays, which support amongst other things laziness, are laid out in memory
200200
in a radically different way to C arrays. Therefore, the NativeCall library offers
@@ -226,7 +226,7 @@ use C<$> all the way when using NativeCall. :-)
226226
Getting return values for arrays works out just the same.
227227
228228
Some library APIs may take an array as a buffer that will be populated by the
229-
C function and, for, instance, return the actual number of items populated:
229+
C function and, for instance, return the actual number of items populated:
230230
231231
sub get_n_ints(CArray[int32], int32) returns int32 is native('ints') { * }
232232
@@ -330,8 +330,8 @@ instead:
330330
331331
TBD more
332332
333-
You can type your C<Pointer> with passing the type as parameter. It works with native type
334-
but also C<CArray> and C<CStruct> defined type. NativeCall will not implicitly alloc the memory for it
333+
You can type your C<Pointer> by passing the type as a parameter. It works with the native type
334+
but also with C<CArray> and C<CStruct> defined types. NativeCall will not implicitly alloc the memory for it
335335
even when calling new on them.
336336
It's mostly useful in the case of a C routine returning a pointer, or if it's a pointer
337337
embedded in a C<CStruct>.
@@ -379,10 +379,10 @@ The C<native> trait accepts the library name or the full path.
379379
sub mysql_affectied_rows( .. ) returns int32 is native(LIBMYSQL);
380380
sub bar is native(LIBFOO);
381381
382-
You can also put incomplete path like './foo', NativeCall will automaticly put
382+
You can also put an incomplete path like './foo', NativeCall will automatically put
383383
the right extension according to the plateform specification.
384384
385-
BE CAREFUL: the C<native> trait and C<constant> are evalued at compile time. Don't write a constant
385+
BE CAREFUL: the C<native> trait and C<constant> are evaluated at compile time. Don't write a constant
386386
that depend on dynamic variable like:
387387
388388
constant LIBMYSQL = %*ENV<P6LIB_MYSQLCLIENT> || 'mysqlclient';
@@ -393,12 +393,12 @@ keep the value it get evaluated when the module get precompiled.
393393
=head2 ABI/API Version
394394
395395
If you write C<native('foo')> NativeCall will search libfoo.so under Unix like system (libfoo.dynlib on Os X, foo.dll on win32).
396-
In most modern system it will requiere you or the user of your module to install
397-
the develepment package because it's recommanded to always provide an API/ABI version to a
396+
In most modern system it will require you or the user of your module to install
397+
the develepment package because it's recommended to always provide an API/ABI version to a
398398
shared library, so libfoo.so ends often being a symbolic link provided only by a devel package.
399399
400-
To avoid that, the C<native> trait allow you to specify the API/ABI version. It can be a full
401-
version or just a part of it (Try to stick to Major version, some BSD does not care for minor)
400+
To avoid that, the C<native> trait allows you to specify the API/ABI version. It can be a full
401+
version or just a part of it. (Try to stick to Major version, some BSD code does not care for Minor.)
402402
403403
sub foo is native('foo', v1); # Will try to load libfoo.so.1
404404
sub foo is native('foo', v1.2.3); # Will try to load libfoo.so.1.2.3

0 commit comments

Comments
 (0)