perl-ctypes:perl-ctypes.git
7 years agoAdded types.t: new failing tests for Types py_style_call
Ryan Jendoubi [Fri, 9 Jul 2010 03:17:46 +0000 (04:17 +0100)]
Added types.t: new failing tests for Types

new file:   t/types.t

7 years agoCleaned up pod-coverage.t for Type.pm
Ryan Jendoubi [Fri, 9 Jul 2010 03:00:15 +0000 (04:00 +0100)]
Cleaned up pod-coverage.t for Type.pm

modified:   lib/Ctypes/Type.pm
modified:   t/pod-coverage.t

7 years agoCleaned up win-proto.t and manifest.t
Ryan Jendoubi [Fri, 9 Jul 2010 01:04:48 +0000 (02:04 +0100)]
Cleaned up win-proto.t and manifest.t

modified:   MANIFEST
modified:   t/win-proto.t

7 years agoIncorporate improved ::Function::sig from branch
Ryan Jendoubi [Thu, 1 Jul 2010 10:23:04 +0000 (11:23 +0100)]
Incorporate improved ::Function::sig from branch

Pulled in from callbacks branch

modified:   lib/Ctypes/Function.pm

7 years agoCleanup _call variable declarations
Ryan Jendoubi [Tue, 29 Jun 2010 18:11:14 +0000 (19:11 +0100)]
Cleanup _call variable declarations

modified:   Ctypes.xs

7 years agoMerge types and prototypes API.
Reini Urban [Mon, 28 Jun 2010 19:16:10 +0000 (21:16 +0200)]
Merge types and prototypes API.
Improve pod, and add API for the utilities.

7 years agoBetter _call error detection, improve test coverage
Reini Urban [Sun, 27 Jun 2010 10:06:59 +0000 (12:06 +0200)]
Better _call error detection, improve test coverage

Strict check sig for string, otherwise the first arg can be stringified to
  something which looks like a sig.
Test wrong _call usage: coverage 43% - only the types are missing now

7 years agomore DLL docs
Reini Urban [Thu, 24 Jun 2010 20:16:44 +0000 (22:16 +0200)]
more DLL docs

7 years agoMore reading of python ctypes:
Reini Urban [Thu, 24 Jun 2010 20:05:49 +0000 (22:05 +0200)]
More reading of python ctypes:
  renamed rtype => restype, atypes => argtypes
  restype is a DLL default

enhanced POD
out-commented const-*.inc

7 years agoSupport pack-style strings for atypes (brevity)
Reini Urban [Thu, 24 Jun 2010 19:12:14 +0000 (21:12 +0200)]
Support pack-style strings for atypes (brevity)
Fix pod sample.

7 years agoReorder private funcs
Ryan Jendoubi [Thu, 24 Jun 2010 10:33:45 +0000 (11:33 +0100)]
Reorder private funcs

modified:   lib/Ctypes/Function.pm

7 years agoMerge branch 'master' of gitorious.org:perl-ctypes/perl-ctypes
Ryan Jendoubi [Thu, 24 Jun 2010 10:30:52 +0000 (11:30 +0100)]
Merge branch 'master' of gitorious.org:perl-ctypes/perl-ctypes

7 years agoFinished adding rurban's logic to Function::new
Ryan Jendoubi [Thu, 24 Jun 2010 10:29:07 +0000 (11:29 +0100)]
Finished adding rurban's logic to Function::new

Defaults now set for $rtype and $abi, checking done on latter.
_call also becomes much simpler.

modified:   lib/Ctypes/Function.pm

7 years agoremove pod for unused validate_types
Reini Urban [Wed, 23 Jun 2010 19:52:22 +0000 (21:52 +0200)]
remove pod for unused validate_types

7 years ago::Function API more like C::DynaLib/Python ctypes
Ryan Jendoubi [Wed, 23 Jun 2010 19:19:01 +0000 (20:19 +0100)]
::Function API more like C::DynaLib/Python ctypes

Should be more internally consistent. Get/set sig now updates
abi, rtype, atypes. Actual sig passed at call time put together
from these three attributes.
See new POD.

modified:   lib/Ctypes/Function.pm

7 years agoMerge branch 'master' of gitorious.org:perl-ctypes/perl-ctypes
Reini Urban [Tue, 22 Jun 2010 18:34:05 +0000 (20:34 +0200)]
Merge branch 'master' of gitorious.org:perl-ctypes/perl-ctypes

Protect from no arg definitions in sig.
func-access.t: skips needs the number
  fix sig (again)

Conflicts:
t/func-access.t

7 years agoRename base class Ctypes::Library to Ctypes:DLL which sounds more natural.
Reini Urban [Tue, 22 Jun 2010 18:22:49 +0000 (20:22 +0200)]
Rename base class  Ctypes::Library to Ctypes:DLL which sounds more natural.
More pod and fix some tests. sigs not sound still.

7 years agoSubstantially simplified rules for sig/abi/rtype
Ryan Jendoubi [Tue, 22 Jun 2010 14:37:17 +0000 (15:37 +0100)]
Substantially simplified rules for sig/abi/rtype

sig must Always be present and will Always be taken to mean
<abi><rtype><arg types>. If abi or rtype are defined separately
they will be substituted in at call time (and sig redefined to
match).

Updated POD and tests to match.

modified:   lib/Ctypes/Function.pm
modified:   t/002-Function.t
modified:   t/func-access.t
modified:   t/library.t

7 years agoUpdated Ctypes.xs, working on x86_64
Ryan Jendoubi [Tue, 22 Jun 2010 11:22:15 +0000 (12:22 +0100)]
Updated Ctypes.xs, working on x86_64

From branch 'abi_default'

7 years agoMerge, and simplified abi_default
Ryan Jendoubi [Tue, 22 Jun 2010 11:09:45 +0000 (12:09 +0100)]
Merge, and simplified abi_default

Conflicts:
lib/Ctypes/Function.pm

7 years agoMake function decl and calls via libraries work
Reini Urban [Tue, 22 Jun 2010 08:13:28 +0000 (10:13 +0200)]
Make function decl and calls via libraries work
t/library.t passes

7 years agoFixed the default _abi for libraries
Reini Urban [Tue, 22 Jun 2010 07:43:01 +0000 (09:43 +0200)]
Fixed the default _abi for libraries
  (compile-time __PACKAGE__ to run-time ref)

7 years agoChange back from atypes to sig, though this is really confusing and NOT
Reini Urban [Tue, 22 Jun 2010 07:22:31 +0000 (09:22 +0200)]
Change back from atypes to sig, though this is really confusing and NOT
the recommended API. You should really keep atypes, or let the user use
the whole sig for simplicity.
Improve pod. Function tests passes now.

7 years agofix syntax error but the logic is horrible
Reini Urban [Mon, 21 Jun 2010 23:53:14 +0000 (01:53 +0200)]
fix syntax error but the logic is horrible

7 years agoMerge branch 'abi_default'
Ryan Jendoubi [Mon, 21 Jun 2010 23:39:24 +0000 (00:39 +0100)]
Merge branch 'abi_default'

7 years agoSyntax error
Ryan Jendoubi [Mon, 21 Jun 2010 23:38:59 +0000 (00:38 +0100)]
Syntax error

modified:   lib/Ctypes/Function.pm

7 years agoMerge 'abi_default' work
Ryan Jendoubi [Mon, 21 Jun 2010 23:20:54 +0000 (00:20 +0100)]
Merge 'abi_default' work

Conflicts:
t/002-Function.t

modified:   MANIFEST
modified:   lib/Ctypes/Function.pm
modified:   t/002-Function.t

7 years ago(Temporarily) usable abi_default() in Function.pm
Ryan Jendoubi [Mon, 21 Jun 2010 23:16:41 +0000 (00:16 +0100)]
(Temporarily) usable abi_default() in Function.pm

Only understands 'c', 's', 'MSWin32', 'linux' and 'cygwin'.
Would Devel::CheckOS be an acceptable dependency?

modified:   MANIFEST
modified:   lib/Ctypes/Function.pm
modified:   t/002-Function.t

7 years agomerge conflicts
Reini Urban [Mon, 21 Jun 2010 22:18:09 +0000 (00:18 +0200)]
merge conflicts

7 years agoSpecify function declarations via AUTOLOAD vs calls via ->
Reini Urban [Mon, 21 Jun 2010 22:14:29 +0000 (00:14 +0200)]
Specify function declarations via AUTOLOAD vs calls via ->
copy float values to destination to avoid compiler errors
(func calls still fail though)

7 years agoRename 001-math.t -> 001-_call.t
Ryan Jendoubi [Mon, 21 Jun 2010 21:55:29 +0000 (22:55 +0100)]
Rename 001-math.t -> 001-_call.t

7 years agoCtypes::_call working / 001-math.t passing
Ryan Jendoubi [Mon, 21 Jun 2010 21:52:03 +0000 (22:52 +0100)]
Ctypes::_call working / 001-math.t passing

Corrected dereferencing of rvalue at end of Ctypes.xs.

modified:   Ctypes.xs

7 years agoMake the calling chain via AUTOLOAD work
Reini Urban [Mon, 21 Jun 2010 12:45:01 +0000 (14:45 +0200)]
Make the calling chain via AUTOLOAD work
  CDLL->lib ok
  CDLL->lib->func ok
  CDLL->lib->func({sig},args) nok

7 years agorename Ctypes::find_library to Ctypes::load_library
Reini Urban [Mon, 21 Jun 2010 08:41:51 +0000 (10:41 +0200)]
rename Ctypes::find_library to Ctypes::load_library
fix and extend pod

7 years agomerge master
Reini Urban [Mon, 21 Jun 2010 07:07:37 +0000 (09:07 +0200)]
merge master

7 years agoUpdate master & merge doubi's Function.pm
Ryan Jendoubi [Mon, 21 Jun 2010 00:06:37 +0000 (01:06 +0100)]
Update master & merge doubi's Function.pm

Conflicts:
lib/Ctypes/Function.pm
t/002-Function.t

modified:   lib/Ctypes.pm
modified:   lib/Ctypes/Function.pm
modified:   t/002-Function.t

7 years agoStylistic changes
Ryan Jendoubi [Sun, 20 Jun 2010 23:55:00 +0000 (00:55 +0100)]
Stylistic changes
modified:   lib/Ctypes/Function.pm

7 years agoCommit before incorporating rurban's patches
Ryan Jendoubi [Sun, 20 Jun 2010 22:50:50 +0000 (23:50 +0100)]
Commit before incorporating rurban's patches

Lots more documentation in Function.pm, started on abi_default()
class method.

modified:   lib/Ctypes.pm
modified:   lib/Ctypes/Function.pm

7 years agofix perms
Reini Urban [Sun, 20 Jun 2010 18:01:33 +0000 (20:01 +0200)]
fix perms
change signatures to match python ctypes
add stubs for library packages
add tests for prototypes, library and function objects

7 years agofind_library: resolve possible ld script
Reini Urban [Sun, 20 Jun 2010 14:01:06 +0000 (16:01 +0200)]
find_library: resolve possible ld script
improve doc

7 years agoadd longdouble to check, no croak in tests
Reini Urban [Sun, 20 Jun 2010 13:31:34 +0000 (15:31 +0200)]
add longdouble to check, no croak in tests

7 years agodo not croak in tests
Reini Urban [Sun, 20 Jun 2010 13:26:09 +0000 (15:26 +0200)]
do not croak in tests
add D - long double to sig check
comment c abi for 64bit

7 years agoMerge branch 'master' of git://gitorious.org/perl-ctypes/perl-ctypes
Reini Urban [Sun, 20 Jun 2010 12:59:05 +0000 (14:59 +0200)]
Merge branch 'master' of git://gitorious.org/perl-ctypes/perl-ctypes

7 years agoFix and extend Ctypes::Function,
Reini Urban [Sun, 20 Jun 2010 12:21:19 +0000 (14:21 +0200)]
Fix and extend Ctypes::Function,
  positional and named params with proper defaults.
Added Ctypes find_library and find_function to extend DynaLoader
Added documentation
Makefile.PL debugging args are optional and perl-specific.
  use a debugging perl to use -g3,
  use perl Makefile.PL DEFINE=-DCTYPES_DEBUG for debugging the XS

7 years agocleanup file permissions from windows, add use Carp
Reini Urban [Sun, 20 Jun 2010 09:31:15 +0000 (11:31 +0200)]
cleanup file permissions from windows, add use Carp

7 years agoWorking test for ::Function, more logic needed v0.001
Ryan Jendoubi [Sun, 20 Jun 2010 05:22:12 +0000 (06:22 +0100)]
Working test for ::Function, more logic needed

Need to add logic for sig validation and putting together ::call
sig from sig, abi & rtype.

modified:   lib/Ctypes/Function.pm
modified:   t/002-Function.t

7 years agoFixed ::new, created ::update
Ryan Jendoubi [Sun, 20 Jun 2010 03:52:02 +0000 (04:52 +0100)]
Fixed ::new, created ::update

Realised ::new wasn't putting $func back in the object hash: all
local vars changed to references.

Created update function for resetting Function's name, sig, abi &
rtype all at once. Wrote it in _call then realised it was wrong
there, but thought it might be useful.

modified:   lib/Ctypes/Function.pm
modified:   t/002-Function.t

7 years agoCtypes::Function: blessing hashref, overloading '&{}'
Ryan Jendoubi [Sun, 20 Jun 2010 01:06:32 +0000 (02:06 +0100)]
Ctypes::Function: blessing hashref, overloading '&{}'

&{} was simplest in the end (Last one I tried~)

Got AUTOLOAD working ok, but might be a more elegant way of
dealing with whether a particular data member is mutable.

Next: cleaning up, implementing _call, writing tests.

modified:   lib/Ctypes/Function.pm
modified:   t/002-Function.t

7 years agoSubref-blessing method seems to work better
Ryan Jendoubi [Sat, 19 Jun 2010 15:13:04 +0000 (16:13 +0100)]
Subref-blessing method seems to work better

Next will check if accessors can be used
modified:   lib/Ctypes/Function.pm
modified:   t/002-Function.t

7 years agoBlessing glob not working
Ryan Jendoubi [Sat, 19 Jun 2010 14:53:27 +0000 (15:53 +0100)]
Blessing glob not working

Not sure why, going to try blessing coderef instead
modified:   lib/Ctypes/Function.pm
modified:   t/002-Function.t

7 years agoNew Ctypes::Function test (failing)
Ryan Jendoubi [Sat, 19 Jun 2010 12:18:27 +0000 (13:18 +0100)]
New Ctypes::Function test (failing)

Ironing out syntax bugs - not sure of logic yet
new file:   t/002-Function.t

modified:   lib/Ctypes/Function.pm

7 years agoPart way through creating Ctypes::Function
Ryan Jendoubi [Fri, 18 Jun 2010 20:32:27 +0000 (21:32 +0100)]
Part way through creating Ctypes::Function

Quite like the equivalent in FFI.pm. Using libffi makes it much
simpler than C::DL or P5NCI.
new file:   lib/Ctypes/Function.pm

7 years agoCreated some Perl-side type checking for numeric args
Ryan Jendoubi [Thu, 17 Jun 2010 02:16:14 +0000 (03:16 +0100)]
Created some Perl-side type checking for numeric args

Simple effect of calling ord() on a string passed where an 'i'
argtype has been specified. Should probably warn about that.
Should this be done in C instead?

modified:   Ctypes.xs
modified:   lib/Ctypes.pm
modified:   t/001-math.t

7 years agoAdded passing test to highlight ffi_arg issue (ret type size)
Ryan Jendoubi [Thu, 17 Jun 2010 01:06:08 +0000 (02:06 +0100)]
Added passing test to highlight ffi_arg issue (ret type size)

1 main test passes on my 32bit Debian Linux and 1 fails.
Passes when rvalue is an int, but fails when it's double
(as ffi_arg has 4 bytes, double 8 bytes on this system).
modified:   Ctypes.xs
modified:   t/001-math.t

7 years agoAdded patches 4-6 (1-3 already in master)
Ryan Jendoubi [Wed, 16 Jun 2010 22:14:04 +0000 (23:14 +0100)]
Added patches 4-6 (1-3 already in master)

Patch description:
4: set rtype, fixes ffi_prep_cif call
5: Fix c++-style comments to ANSI C Remove call with uninitialized
   rvalue Fix return types
6: proper error messages

modified:   Ctypes.xs

7 years agoproper error messages
Reini Urban [Wed, 16 Jun 2010 21:22:11 +0000 (23:22 +0200)]
proper error messages

7 years agoFix c++-style comments to ANSI C
Reini Urban [Wed, 16 Jun 2010 21:14:41 +0000 (23:14 +0200)]
Fix c++-style comments to ANSI C
Remove call with uninitialized rvalue
Fix return types

7 years agoset rtype, fixes ffi_prep_cif call
Reini Urban [Wed, 16 Jun 2010 21:00:55 +0000 (23:00 +0200)]
set rtype, fixes ffi_prep_cif call

7 years agomerge origin
Reini Urban [Wed, 16 Jun 2010 20:52:09 +0000 (22:52 +0200)]
merge origin

7 years agoFixed sigsegv after adding ffi_arg for rvalue
Ryan Jendoubi [Tue, 15 Jun 2010 22:52:30 +0000 (23:52 +0100)]
Fixed sigsegv after adding ffi_arg for rvalue

Now need to correct the stack (erroring after leaving XSUB).
modified:   Ctypes.xs
modified:   Makefile.PL
modified:   t/000-load.t

7 years agoUpdated debugging options
Ryan Jendoubi [Tue, 15 Jun 2010 00:19:00 +0000 (01:19 +0100)]
Updated debugging options

Replaced multitude of messy ifdefs with one variadic ifdef.
Added -DCTYPES_DEBUG option to Makefile.PL (commendted out).
modified:   Ctypes.xs
modified:   Makefile.PL

7 years agoMerge branch 'new' - patches from rurban
Ryan Jendoubi [Mon, 14 Jun 2010 23:43:35 +0000 (00:43 +0100)]
Merge branch 'new' - patches from rurban

7 years ago"Change" to const-c.inc: proper non-win32 hashbang
Ryan Jendoubi [Mon, 14 Jun 2010 23:42:59 +0000 (00:42 +0100)]
"Change" to const-c.inc: proper non-win32 hashbang
modified:   const-c.inc

7 years agoSomething else
Ryan Jendoubi [Mon, 14 Jun 2010 23:32:52 +0000 (00:32 +0100)]
Something else

7 years agoSomething
Ryan Jendoubi [Mon, 14 Jun 2010 21:47:46 +0000 (22:47 +0100)]
Something

7 years agoadded typemap for ffi_type
Reini Urban [Sun, 13 Jun 2010 20:01:52 +0000 (22:01 +0200)]
added typemap for ffi_type

7 years agofix perms
Reini Urban [Sun, 13 Jun 2010 19:03:01 +0000 (21:03 +0200)]
fix perms
add const-*.inc
fix pod
add Makefile depend section

7 years agoproper ffi_arg rvalue
Reini Urban [Sun, 13 Jun 2010 18:28:43 +0000 (20:28 +0200)]
proper ffi_arg rvalue
use call ABI
improve 001-math.t

7 years agoChanged use verison 5.10.1 -> 5.10
Ryan Jendoubi [Sat, 12 Jun 2010 08:26:57 +0000 (09:26 +0100)]
Changed use verison 5.10.1 -> 5.10

Not sure what I should do about ppport.h?

With thanks to Robin Smidsrød.
modified:   Makefile.PL
modified:   lib/Ctypes.pm

7 years agoAdded support (or at least recognition) of void return types
Ryan Jendoubi [Tue, 8 Jun 2010 20:27:00 +0000 (21:27 +0100)]
Added support (or at least recognition) of void return types
modified:   Ctypes.xs

7 years agoMaking 001-math.t work on MSWin32.
Ryan Jendoubi [Tue, 8 Jun 2010 16:55:02 +0000 (17:55 +0100)]
Making 001-math.t work on MSWin32.

Merge gitorious.org:perl-ctypes/perl-ctypes

Conflicts:
Changes
README
lib/Ctypes.pm

modified:   t/001-math.t

7 years agoThink this might have been caused by line ending changes
Ryan Jendoubi [Tue, 8 Jun 2010 16:41:39 +0000 (17:41 +0100)]
Think this might have been caused by line ending changes

7 years agoChanged var names in t/001-math.t
Ryan Jendoubi [Tue, 8 Jun 2010 16:37:29 +0000 (17:37 +0100)]
Changed var names in t/001-math.t

7 years agoMerge branch 'linux'
Ryan Jendoubi [Tue, 8 Jun 2010 10:52:24 +0000 (11:52 +0100)]
Merge branch 'linux'

Conflicts:
.gitignore
Changes
Ctypes.xs
MANIFEST
Makefile.PL
README
lib/Ctypes.pm

7 years agoMerge gitorious.org:perl-ctypes/perl-ctypes into linux
Ryan Jendoubi [Tue, 8 Jun 2010 10:39:45 +0000 (11:39 +0100)]
Merge gitorious.org:perl-ctypes/perl-ctypes into linux

Conflicts:
.gitignore
ignore.txt
include/const-c.inc
t/000-load.t
t/001-math.t

7 years agoCommit because of line changes?
Ryan Jendoubi [Tue, 8 Jun 2010 10:12:46 +0000 (11:12 +0100)]
Commit because of line changes?

7 years agoChanges from a straight cp -r from Linux
Ryan Jendoubi [Tue, 8 Jun 2010 10:07:41 +0000 (11:07 +0100)]
Changes from a straight cp -r from Linux

7 years agoGot basic ffi_call working (properly this time [I think ])
doubi [Tue, 8 Jun 2010 03:24:59 +0000 (04:24 +0100)]
Got basic ffi_call working (properly this time [I think ])

Made did Newxc(result, 1, <type>, <type>) based on the func sig,
to make *result actually assignable-to; before it was just a
pointer to ffi_type, silly.

Moved main ffi headers one dir up from /include/win32, being
common across platforms as they are. Might have to think later
about making sure gcc will find headers for more recent locally
installed versions first.

Also spent some time tidying up the manifest and suchlike. We
have an ignore.txt, .gitignore and a MANIFEST.SKIP - seems
a little redundant.
Committer: doubi <doubi@doubuntu.(none)>
modified:   Ctypes.xs
new file:   MANIFEST.SKIP
renamed:    include/win32/ffi.h -> include/ffi.h
renamed:    include/win32/ffi_common.h -> include/ffi_common.h
renamed:    include/win32/ffitarget.h -> include/ffitarget.h

7 years agoInitial commit (from Ubuntu 10.4)
doubi [Tue, 8 Jun 2010 00:53:23 +0000 (01:53 +0100)]
Initial commit (from Ubuntu 10.4)

7 years agoIncorporated rurban's Ctypes.xs
doubi [Tue, 8 Jun 2010 00:41:25 +0000 (01:41 +0100)]
Incorporated rurban's Ctypes.xs