JSctypes: Difference between revisions
Jump to navigation
Jump to search
(Import instructions) |
m (Add "preliminary documentation" template) |
||
Line 4: | Line 4: | ||
JSctypes can be used to provide pure-JavaScript wrappers for binary libraries. | JSctypes can be used to provide pure-JavaScript wrappers for binary libraries. | ||
{{JSctypes/preliminary}} | |||
== JSctypes reference == | == JSctypes reference == |
Revision as of 16:58, 16 August 2007
JSctypes: a foreign-function library for the SpiderMonkey JavaScript Engine
JSctypes is a foreign-function library for the SpiderMonkey JavaScript engine used by Mozilla. It provides C-compatible data types and allows JS code to call functions in shared libraries (DLLs) and implement callback functions. The interface and implementation are modeled on the Python ctypes module.
JSctypes can be used to provide pure-JavaScript wrappers for binary libraries.
This is preliminary design documentation and isn't implemented yet!
JSctypes reference
To import JSctypes into a chrome script or JS component:
Components.utils.import("resource://jsctypes/jsctypes.js");
This will import a single JSCtypes object into your script namespace.
- Finding and loading shared libraries
- Data types
- Fundamental data types
- Structured data types
- Arrays and pointers
- Functions
- Non-prototyped functions
- Function prototypes
- Prototyped functions
- Implementing Callback Functions
- Utility functions