Commit Graph

166 Commits

Author SHA1 Message Date
Matthew Flatt
6e40caa7e2 ffi/com: repairs, including `mysterx' compatibility
Restore MysterX-style handling of parameterzied properties in
`com-get-property'.  It turns out that the original `com-get-property'
handles parameterized properties by allowing a list in place of a
property-name string, and that handling got lost in the re-write.

Fix the name of `com-get-active-from-from-coclass'.

Fix arity checking for optional arguments.

Closes PR 13603
Closes PR 13604
2013-03-31 11:12:45 -06:00
Matthew Flatt
cdf0f6b9ab add 'so-mode to `system-type'
To work better with OpenBSD (which has been a problem since we
changed `ffi-lib' to open libraries in "local" mode by default).
2013-03-01 15:20:17 -07:00
Matthew Flatt
17a99bf1d8 docs tweak 2013-02-27 08:53:43 -07:00
Matthew Flatt
d46411d317 ffi/unsafe: add _size', _ssize', _ptrdiff', _intmax', `_uintmax'
These additions could create backward-compatibility problems, but our
searches suggest that problems will be rare; it's more common for
`_size_t' to be incorrectly aliased to `_int', so having definitions
for these standard types is likely to avoid future problems.
2013-02-18 17:01:11 -07:00
Michael Filonenko
840fc9c657 full unboxing for extflonums, plus `ffi/unsafe' support
Includes a repair for floating-point `min' and `max' that affects all
x86 builds that use SSE arithmetic, leaving the (otherwise unused)
floating-point stack in a bad state, which might have affected
x87-using C/foreign libraries running alongside Racket.
2013-02-15 12:15:34 -07:00
Matthew Flatt
3cd4ee1c0d ffi/unsafe: allow multiple values for a `(_fun ... -> _racket)' result
Closes PR 13496
2013-02-14 15:45:26 -07:00
Matthew Flatt
0742424093 ffi/com: doc correction 2013-01-25 05:08:46 -07:00
Matthew Flatt
2adf0bdf2e ffi/unsafe/objc docs: clarification on `import-class'
Merge to v5.3.2
2013-01-13 15:33:48 -07:00
Asumu Takikawa
3885ea7cdd Fix doc typos 2013-01-03 02:27:30 -05:00
Matthew Flatt
b67ca6350c fix doc typo
Closes PR 13353
2013-01-01 15:55:44 -07:00
Matthew Flatt
0f909af765 ffi/com: add `com-get-property*'
Accesses a "parameterized property", which is like a method call
but for a name that is categorized as a property.
2012-12-18 06:39:59 -07:00
Matthew Flatt
4ca7e6bc77 ffi/unsafe: fixes related to `define-cstruct' and properties
Fix the binding context for property and property-value
expressions. Propagate wrappers (and therefore properties)
to cstruct subtypes.
2012-11-11 09:38:15 -07:00
Eli Barzilay
14d8c8b5a5 Newlines at EOFs. 2012-11-06 14:07:15 -05:00
Danny Yoo
dcf4d8b040 adding close-eval at the end of scribble files that have a toplevel evaluator 2012-11-01 15:32:53 -06:00
Matthew Flatt
9708a01a0a ffi/unsafe: defend against some finalization bugs
Turn use of a finalized ffi callout into a reported error,
instead of a crash. Clarify the existence of the finalizer
in the docs. Fix error logging of the finalizer thread.

Merge to v5.3.1
2012-10-21 08:11:45 -06:00
Matthew Flatt
4809c11548 doc fix 2012-09-29 08:59:10 -06:00
Matthew Flatt
3f59309634 ffi/unsafe doc repairs
Closes PR 13143
2012-09-27 08:12:56 -06:00
Matthew Flatt
8bd5dbf7cc ffi/unsafe: change `cast' to avoid pitfalls for you
The old `cast' didn't work right for a mismatch between
a pointer GCableness and the source or target types, and
it didn't work right for an GCable pointer with a non-zero
offset. While those pitfalls were documented, the first
of them definitely has been a source of bugs in code that
I wrote.

Also added `cpointer-gcable?'
2012-09-04 15:28:18 -06:00
Matthew Flatt
9f9f91207f ffi/com: add an ActiveX example to the docs 2012-09-01 16:05:37 -06:00
Matthew Flatt
eb7fd51d02 ffi/com: add `any ...' support for method arguments
Also allow `?' for the length of an array and suport VT_SAFEARRAY
arguments (mostly the same as VT_ARRAY).
2012-09-01 09:48:35 -06:00
Matthew Flatt
d11e58b639 ffi/unsafe/atomic: add `in-atomic-mode?'
The new function can be useful for debugging, at least.
2012-08-31 07:33:08 -06:00
Matthew Flatt
088d1dadb4 add ffi/unsafe/nsalloc' and ffi/unsafe/nsstring' 2012-08-24 15:48:58 -06:00
Matthew Flatt
3c744229e8 ffi/unsafe docs: improve `_cprocedure' docs
Among other improvements, add information about reachability of
callout arguments.
2012-08-21 08:42:33 -06:00
Matthew Flatt
bb3545ddf7 ffi/unsafe/custodian: #:atexit?' -> #:at-exit?' 2012-08-12 20:25:47 -06:00
Matthew Flatt
42ef79c2ad add `ffi/unsafe/custodian' 2012-08-12 20:17:29 -06:00
Matthew Flatt
38ce4997a9 ffi/com: fix potential interaction of finalization and custodians
Includes new `#:manage?' optional argument to `make-com-object'
and better management of internally created objects.

Merge to v5.3
2012-08-02 16:29:03 -06:00
Matthew Flatt
1f3f180805 ffi/unsafe/atomic: doc repair 2012-08-02 16:29:02 -06:00
Eli Barzilay
7ec9975736 Move regexp-replaces' from ffi/unsafe' to `racket/private/string'.
* The old function was removed completely, people will get it from
  `racket/base' anyway.

* I also removed its documentation.  I thought about leaving a note in,
  but if `define-ffi-definer' is the preferred style, then this should
  be done when there's a way to make `define-ffi-definer' use it.  (Eg,
  some new #:keyword that adds a way to change the defined name.)

* Note that the function is added to `racket/private/string' and not to
  `racket/string' because the latter deals only with strings, and the
  new function accepts byte strings too.  It might be better to start a
  new `racket/regexp' module for these functions.
2012-06-22 14:27:14 -04:00
Matthew Flatt
a04ba8aef3 ffi/com: allow a `com-object' as an 'iunknown argument 2012-06-22 09:47:59 +08:00
Matthew Flatt
fbb6a294f3 local-expand' allows a stop list to have only module*'
That is, when the sto plist contains only `module*', core
forms are not implicitly added to the stop list.
2012-06-08 16:08:55 +08:00
Matthew Flatt
85a2267e6c ffi/unsafe: new error message convention at primitives
Also, fix FFI procedures to preserve names: change `ptr-ref' with
`_fpointer' on an `ffi-obj' value to return the `ffi-obj'
value, so that the name in the `ffi-obj' value can be used
by `_cprocedure'.

Closes PR 12645
2012-06-01 19:03:43 -07:00
Matthew Flatt
09cb2a348f ffi/com: add 'variant type description
Used to prevent extra array dimensions and instead construct nested
arrays.
2012-05-26 06:38:02 -06:00
Matthew Flatt
38e628be80 ffi/com: add support for type descriptions on values 2012-04-16 08:47:13 -06:00
Matthew Flatt
4179cbfa63 enforce ranges on all integer types
DO NOT merge to 5.3
2012-04-15 05:37:44 -06:00
Matthew Flatt
89ef600b6e ffi/unsafe/com: com-object->eq?' implies equal?' 2012-04-03 18:36:27 -06:00
Matthew Flatt
738cac3d24 generalize `malloc' to allow a 0-sized request
Past experience suggests that this is generally better than adding
`zero?' tests at various places that might otherwise call `malloc'.
2012-03-29 14:55:14 -06:00
Siddharth Agarwal
a73b9bb788 ffi: extend _list and _vector to support zero-length output 2012-03-29 14:55:14 -06:00
Matthew Flatt
2d7b97ece9 doc and terminology fix 2012-02-26 22:13:02 -05:00
Matthew Flatt
b9012a2504 COM doc and error fixups 2012-02-21 06:14:44 -07:00
Matthew Flatt
a884c91720 ffi/unsafe: add `array-length'
Closes PR 12576
2012-02-20 08:09:06 -07:00
Asumu Takikawa
b890f7d907 Docs: fix example in FFI intro 2012-02-17 10:02:36 -05:00
Matthew Flatt
6cd2e3c71b add `prop:cpointer'
Extend `define-cstruct' to support #:property specs, which causes
the constructor and C->Racket coercsions to wrap the pointer in
a structure instance with the specified properties. Of course,
the wrapper structure has a `prop:cpointer' property so that the
wrapper can be used transparently as a C pointer.

Add missing tests and documentation for the id`->list', `list->'id,
id`->list*', and `list*->'id bindings created by `define-cstruct'.
2012-02-14 14:25:55 -07:00
Matthew Flatt
13a5b0c623 change `ffi-lib' to not make library symbols global by default 2012-01-26 09:30:25 -05:00
Matthew Flatt
877d528ed3 improve docs for `cast' with warnings about potential bugs 2012-01-23 07:36:44 -07:00
Matthew Flatt
ff41a896bc add ffi/com', ffi/unsafe/com' 2012-01-10 18:35:32 -07:00
Matthew Flatt
1ebde53db7 fix `compiler-sizeof' docs and error message 2011-11-30 07:39:36 -07:00
Eric Hanchrow
23d38b14a4 Add missing word 2011-10-22 20:58:56 -04:00
Matthew Flatt
e71abf5aba Add a tutorial to the FFI overview 2011-10-21 20:34:51 -06:00
Matthew Flatt
5724aa1d1b doc clarifications
Merge to 5.2
2011-10-10 14:45:53 -06:00
Matthew Flatt
f38e57ff68 add #:get-lib-dirs and #:fail args to `ffi-lib'
Not currently used, because an experiment that used the additions
was abandoned, but another use in the future seems likely.
2011-10-05 06:28:30 -06:00