Commit Graph

155 Commits

Author SHA1 Message Date
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
John Clements
9b91d37032 added entry for cstruct->list converter 2011-09-06 10:05:42 -07:00
Kevin Tew
d5d28d3357 fix [] to {} 2011-08-30 11:27:18 -06:00
Kevin Tew
07c5c076e2 Fix cpointer and cstruct tag text 2011-08-30 09:52:06 -06:00
Kevin Tew
a810b30b87 remove underscore from cpointer key 2011-08-29 08:44:32 -06:00
Kevin Tew
0f595f4882 docs cpointers over place-channels 2011-08-23 14:02:01 -06:00
Matthew Flatt
345b06838d FFI: add C arrays and unions 2011-08-20 10:24:32 -06:00
Matthew Flatt
9a14b47ccc doc typo
Closes PR 12006
2011-08-02 17:15:23 -06:00
Eli Barzilay
3157955d40 ".ss" -> ".rkt" scan done. 2011-07-02 10:37:53 -04:00
Ryan Culpepper
1b702a2ae3 docs reorganization
added tutorial, racket categories
  relabeled some other categories
  normalized manual names: de-bolded, changed some names
2011-07-01 17:16:53 -06:00
Matthew Flatt
59731368fc add ffi/winapi; use it in mzlib/os
Closes PR 12007
2011-07-01 10:42:17 -06:00
Matthew Flatt
1160d3df62 remove syntax certificates; add syntax taints 2011-06-29 19:15:48 -06:00