mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-07 13:16:34 +02:00
Sync from master
This commit is contained in:
parent
870abdabc6
commit
1aeff7cf66
1 changed files with 12 additions and 0 deletions
|
@ -17,9 +17,11 @@ title: User Manual
|
||||||
- [Language Details](#language-details)
|
- [Language Details](#language-details)
|
||||||
- [Multithreaded Programming](#multithreaded-programming)
|
- [Multithreaded Programming](#multithreaded-programming)
|
||||||
- [Foreign Function Interface](#foreign-function-interface)
|
- [Foreign Function Interface](#foreign-function-interface)
|
||||||
|
- [Writing a Scheme Function in C](#writing-a-scheme-function-in-c)
|
||||||
- [Writing a Scheme Function in C](#writing-a-scheme-function-in-c)
|
- [Writing a Scheme Function in C](#writing-a-scheme-function-in-c)
|
||||||
- [Including a C Header File](#including-a-c-header-file)
|
- [Including a C Header File](#including-a-c-header-file)
|
||||||
- [Linking to a C Library](#linking-to-a-c-library)
|
- [Linking to a C Library](#linking-to-a-c-library)
|
||||||
|
- [Calling Scheme Functions from C](#calling-scheme-functions-from-c)
|
||||||
- [Licensing](#licensing)
|
- [Licensing](#licensing)
|
||||||
- [References and Further Reading](#references-and-further-reading)
|
- [References and Further Reading](#references-and-further-reading)
|
||||||
|
|
||||||
|
@ -216,6 +218,10 @@ Functions that may block must call the `set_thread_blocked` macro to let the sys
|
||||||
|
|
||||||
The Cyclone runtime can be used as a reference for how to write your own C functions. A good starting point would be [`runtime.c`](../runtime.c) and [`types.h`](../include/cyclone/types.h).
|
The Cyclone runtime can be used as a reference for how to write your own C functions. A good starting point would be [`runtime.c`](../runtime.c) and [`types.h`](../include/cyclone/types.h).
|
||||||
|
|
||||||
|
## Foreign Library
|
||||||
|
|
||||||
|
The [`(cyclone foreign)`](api/cyclone/foreign) provides a convenient interface for integrating with C code, and provides higher-level constructs than `define-c`. See the API documentation for more information.
|
||||||
|
|
||||||
## Including a C Header File
|
## Including a C Header File
|
||||||
|
|
||||||
A C header may be included using the `include-c-header` special form. This special form may be used either as part of a library definition:
|
A C header may be included using the `include-c-header` special form. This special form may be used either as part of a library definition:
|
||||||
|
@ -244,6 +250,12 @@ A Cyclone library may use the `c-linker-options` expression to instruct the comp
|
||||||
(export curl-version)
|
(export curl-version)
|
||||||
(c-linker-options "-lcurl")
|
(c-linker-options "-lcurl")
|
||||||
|
|
||||||
|
## Calling Scheme Functions from C
|
||||||
|
|
||||||
|
C functions `Cyc_scm_call` and `Cyc_scm_call_no_gc` are provided to allow calling Scheme functions from C.
|
||||||
|
|
||||||
|
The best way to get started with these functions is with the code examples in the Cyclone source tree under [`examples/call-scm-from-c`](../examples/call-scm-from-c).
|
||||||
|
|
||||||
# Licensing
|
# Licensing
|
||||||
Cyclone is available under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
|
Cyclone is available under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue