Affix

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

my $offset = offsetof( $struct, 'age' );
```

Returns the offset, in bytes, from the beginning of a structure including
padding, if any.

# Utility Functions

Here's some thin cushions for the rougher edges of wrapping libraries.

They may be imported by name for now but might be renamed, removed, or changed
in the future.

## `cast( ... )`

```perl
my $hash = cast( $ptr, Struct[i => Int, ... ] );
```

This function will parse a pointer into a given target type.

dyncall/ChangeLog  view on Meta::CPAN

  o cleanup of manual and corrections
  o added info about newly supported and/or tested platforms (e.g. FreeBSD on ARM)
  o restructured folder layout for documentation
  o added API doc for dyncallback and dynload
  o added manpages for dyncallback and dynload
tests:
  o added arm/thumb interwork test suite
bindings:
  o godc: added bindings for Go
  o rbdc: fixed and extended ruby bindings
  o shdc: renamed shell binding to shdc and added feature to list shared-objects' symbols


Version 0.7 (2012/01/02)

architecture:
  o added subproject: portasm - portable (GNU AS,+Apple and MASM) assembly framework
  o added subproject: autovar - predefined macro framework (was dyncall_macros.h)
  o added support for Solaris and SunPro compiler for i386, x86_64, sparc and sparc64
  o improved auto-detection via preprocessor defines
dyncall:

dyncall/ChangeLog  view on Meta::CPAN

  o supports SunPro with *.S files.
  o added experimental 'dynMake' portable make-based build-system (not stable, yet)
doc:
  o added dyncallback documentation
  o updated dyncall documentation
  o minor updates
tests:
  o added flexible test suite for calls (call_suite) based on Lua and C
  o added syscall test
  o updates to resolve-self test (adding additional link flags to export symbols)
  o renamed *.cpp -> *.cc files (OpenBSD/Sun make has no implicit rules for cpp)


Version 0.6 (2010/09/25)

buildsys:
  o new build systems: CMake and Plan9's mk
  o buildsys/gmake tool chain update: pcc and iphone sdk
  o x64 bugfix: added "-fPIC" even for static libs
dynload:
  o enum symbols update: Mach-O and Win64 (thanks Olivier)

dyncall/ChangeLog  view on Meta::CPAN

  o interface update: added new abstract mode for ellipsis calls (DC_CALL_C_ELLIPSIS)
docs:
  o comprehensive update
tests:
  o plain: split "plain" test up in C and C++ part
  o callbacksuite: added multiple configuration support for callback_suite


Version 0.5 (2010/02/01)

  o renamed arm9 stuff to arm32
  o added non-EABI ABI for arm32 (before, EABI was the default implementation)
  o added dyncallback support for x64/windows (thanks Olivier), x64/darwin, arm32/arm, arm32/thumb
  o synced documentation again with current state of the source (lots of small changes)
  o updated ruby binding to current state of signature string (still some features missing, though)
  o added a couple of new options to configure scripts (e.g. prefix-bd, new targets, etc.)
  o darwin universal binary support
  o added new tests callback_plain and calback_suite
  o added Haiku/BeOS support


dyncall/ToDo  view on Meta::CPAN

  * test return values
  * convert from c++ to c, to have it also on plan9, and more portability

dynload:
--------
- investigate issue where if dlGetLibraryPath() is called from within a .so,
  passing NULL will return .so name, whereas passing result of
  dlLoadLibrary(NULL) returns process' name
- dlGetLibraryPath: dl_iterate_phdr() used on OpenBSD, but not available on version < 3.7
- bug: test/nm crashes on qemu mips linux o32 debian etch
- rename SymsInit to InitSyms and similar for cleanup function to reflect naming
  in dyncall
- get rid of Dl_info and friends (_GNU_SOURCE) in dynload/dynload_syms_elf.c
  for implementation of dlSymsNameFromValue(..)
- check if PSP can support dynload (missing elf.h, dlfcn.h, etc.); fixup readme if successful
- some functionality like java's System.mapLibraryName('name') might be helpful?
- Failed On Open Solaris 11:
    In file included from dynload_syms.c:28:
    dynload_syms_elf.c:56: error: syntax error before "Elf_Dyn"
    dynload_syms_elf.c:56: warning: data definition has no type or storage class
    dynload_syms_elf.c: In function `dlSymsInit':

lib/Affix.pm  view on Meta::CPAN

    my $struct = Struct[ name => Str, age => Int ];
    my $offset = offsetof( $struct, 'age' );

Returns the offset, in bytes, from the beginning of a structure including
padding, if any.

=head1 Utility Functions

Here's some thin cushions for the rougher edges of wrapping libraries.

They may be imported by name for now but might be renamed, removed, or changed
in the future.

=head2 C<cast( ... )>

    my $hash = cast( $ptr, Struct[i => Int, ... ] );

This function will parse a pointer into a given target type.

The source pointer would have normally been obtained from a call to a native
subroutine that returned a pointer, a lvalue pointer to a native subroutine,



( run in 0.433 second using v1.01-cache-2.11-cpan-e9daa2b36ef )