Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | 2022-09-21 | 6.7 kB |
|
cffi1.2.0-bin-win.zip | 2022-09-21 | 188.9 kB | |
cffi1.2.0-src.tgz | 2022-09-21 | 464.4 kB | |
cffi1.2.0-src.zip | 2022-09-21 | 528.1 kB | |
cffi1.1.0-src.tgz | 2022-08-17 | 461.9 kB | |
cffi1.1.0-src.zip | 2022-08-17 | 526.3 kB | |
cffi1.1.0-bin-win.zip | 2022-08-17 | 185.4 kB | |
cffi1.0.7-src.zip | 2022-06-01 | 522.0 kB | |
cffi1.0.7-src.tgz | 2022-06-01 | 457.1 kB | |
cffi1.0.7-bin-win.zip | 2022-06-01 | 182.0 kB | |
cffi1.0b5-src.zip | 2022-04-04 | 587.2 kB | |
cffi1.0b5-src.tgz | 2022-04-04 | 479.4 kB | |
cffi1.0b5-bin-win.zip | 2022-04-04 | 369.0 kB | |
cffi1.0b4-bin-win.zip | 2022-02-06 | 176.8 kB | |
cffi1.0b4-src.tgz | 2022-02-06 | 400.5 kB | |
cffi1.0b4-src.zip | 2022-02-06 | 468.3 kB | |
cffi1.0b3-src.zip | 2021-12-23 | 394.8 kB | |
cffi1.0b3-bin-win.zip | 2021-12-23 | 151.7 kB | |
cffi1.0b3-src.tgz | 2021-12-23 | 356.2 kB | |
cffi1.0b1-src.zip | 2021-12-08 | 350.0 kB | |
cffi1.0b1-bin-win.zip | 2021-12-08 | 153.0 kB | |
cffi1.0b1-src.tgz | 2021-12-08 | 319.8 kB | |
cffi1.0b0-bin-win.zip | 2021-11-20 | 152.1 kB | |
cffi1.0b0-src.tgz | 2021-11-20 | 308.9 kB | |
cffi1.0b0-src.zip | 2021-11-20 | 339.4 kB | |
cffi1.0a7-src.zip | 2021-09-13 | 330.2 kB | |
cffi1.0a7-bin-win.zip | 2021-09-13 | 161.8 kB | |
cffi1.0a7-src.tgz | 2021-09-13 | 300.6 kB | |
cffi1.0a6-bin-win.zip | 2021-06-22 | 153.7 kB | |
cffi1.0a6-src.zip | 2021-06-22 | 306.0 kB | |
cffi1.0a6-src.tgz | 2021-06-22 | 278.8 kB | |
Totals: 31 Items | 10.1 MB | 5 |
Tcl cffi package
The Tcl cffi
package permits calling C functions in shared libraries from
within Tcl scripts via either the libffi
or dyncall
open source libraries.
The package source repository is at https://github.com/apnadkarni/tcl-cffi.
Documentation is at https://cffi.magicsplat.com. Some additional tutorial material is available at https://www.magicsplat.com/blog/tags/cffi/ and the samples in https://github.com/apnadkarni/tcl-cffi/tree/main/examples.
Source distributions and binary packages for some platforms can be downloaded from https://sourceforge.net/projects/magicsplat/files/cffi.
Building
To build the package from the source, see the BUILD.md
file in the repository
or source distribution.
About the package
Major features of the package are
- Implicit conversions of numerics, strings, structs and arrays
- Safety mechanisms for pointers
- Encoding of string values passed and returned from C functions
- Exception generation based on C function return values
- Proc-like argument processing with defaults, error messages etc.
- Utilities for managing memory and conversion to native formats
- Extensible type aliases and enums
- Introspection
Limitations in the current version include
- No support for asynchronous callbacks
Changes in 1.2.0
- New
Struct
methodstonative!
,setnative!
,getnative!
,getnativefields
to access structures via unsafe pointers. - Type alias for C99
bool
- Miscellaneous bug fixes. See https://github.com/apnadkarni/tcl-cffi/milestone/12?closed=1
Changes in 1.1.0
- Added support for varargs functions
- Added offset argument to
memory fill
,memory tobinary
andmemory tostring
- Added
memory fill!
command - Added support of explicit values in
enum sequence
- Miscellaneous bug fixes See https://github.com/apnadkarni/tcl-cffi/milestone/11?closed=1
Changes in 1.0.7
First official release.
- Load from platform specific directory.
- Install manpages on Unix.
Changes in 1.0b5
-
Added a Cookbook section to documentation to help in mapping C declarations to CFFI.
-
Added the
retval
annotation to return a output parameter as the command result. -
Added
getnativefields
method to retrieve multiple field values from a native struct. -
Added
new
method for struct instances to allocate and initialize a native struct in memory. -
Added implicit and explicit casting for pointers.
-
The
enum value
andenum name
commands now accept defaults. -
Incompatibility The
get
andset
methods for struct instances renamed togetnative
andsetnative
. -
Incompatibility The
callback
andcallback_free
commands are now part of acallback
command ensemble. -
Incompatibility The last element of a bitmask enumeration list returns original integer value.
-
Miscellaneous bug fixes.
Changes in 1.0b4
-
Added
callback
andcallback_free
commands for supporting callbacks from C functions. -
Program element names are now scoped based on namespace at definition time.
-
New methods
set
andget
forStruct
instances to store and retrieve fields in native structs in memory. -
New method
fromnative!
method forStruct
instances. -
New method
fieldpointer
to retrieve the pointer to a field in a native struct. -
Support
string
andunistring
types for struct fields. -
Support default values and
-clear
option forStruct
fields. -
Support
enum
andbitmask
annotations for struct field types as for function parameters. -
Allow enum literals in type declarations in addition to defined enums.
-
New commands
enum clear
andenum flags
. -
New command
alias clear
. -
The
memory allocate
command now accepts a type declaration for specifying allocation size. -
New commands
memory set
,memory set!
,memory get
andmemory get!
to store and retrieve typed values in native form. -
Zero size dynamic arrays are passed as NULL pointers.
-
The
byref
annotation is now permitted on return types to implicitly dereference pointers returned by functions. -
New command
limits
to retrieve range of integer types. -
Support arrays of
string
andunistring
types. -
New command
pointer make
. -
Incompatibility
memory set
command renamed tomemory fill
. -
Incompatibility The format and content of type information returned by
type info
has changed. -
Incompatibility Commands that accept patterns only treat last component in a program element name as a pattern.
Changes in 1.0b3
-
Incompatibility
cffi::dyncall::Library
class renamed tocffi::Wrapper
as it is no longer specific todyncall
. -
Incompatibility The
cffi::dyncall::Symbols
class has been removed. -
Added support for the
libffi
library back end as an alternative todyncall
. The selection is made at build time. SeeBUILD.md
in the source distribution. -
C structs can be returned from functions and passed by value if the
libffi
back end is being used. This is still not supported withdyncall
library.
Changes in 1.0b1
-
Incompatibility Null pointers will now raise a Tcl exception when passed as arguments or returned from functions unless the
nullok
annotation is present. Related to this, thenonzero
annotation can no longer be applied to pointers. -
Incompatibility The format of arguments passed to
onerror
handler has changed. -
The
onerror
,lasterror
anderrno
annotations can be included on parameter definitions and are ignored. This permits common type aliases for return values and paramters. -
The
alias define
command now allows multiple alias definitions to be passed.
Changes in 1.0b0
- Added
help
command for wrapped function list and syntax - Added
enum value
andenum name
to map enumeration values and names - Map enum values for output parameters and return values
- Support arrays for pointers and structs
Changes in 1.0a7
- Support
string
,unistring
andbinary
as return types and output parameters - Support
nonzero
annotation for strings and unistrings - Added
enum
command to define constants and enumerations - Added
bitmask
annotation for integer parameters - Added
onerror
annotation for custom error handlers - Added
disposeonsuccess
annotation to only invalidate pointers on success - Sample
libzip
wrapper in examples directory - Miscellaneous bug fixes. See https://github.com/apnadkarni/tcl-cffi/milestone/1?closed=1 for a full list.