diff --git a/Doc/Manual/Chicken.html b/Doc/Manual/Chicken.html index 3c67611b9..463e829d4 100644 --- a/Doc/Manual/Chicken.html +++ b/Doc/Manual/Chicken.html @@ -24,13 +24,14 @@
  • TinyCLOS
  • Compilation -
  • Linkage +
  • Linking -
  • Typemaps -
  • Pointers -
  • Unsupported features +
  • Typemaps +
  • Pointers +
  • Unsupported features @@ -68,7 +69,7 @@ greater than or equal to 1.40.

    CHICKEN can be downloaded from http://www.call-with-current-continuation.org/chicken.html + href="http://www.call-with-current-continuation.org/">http://www.call-with-current-continuation.org/ You may want to look at any of the examples in Examples/chicken/ or Examples/GIFPlot/Chicken for the basic steps to run SWIG @@ -133,9 +134,8 @@ Given a C variable, function or constant declaration named Foo_Bar_to_Foo_Baz, the declaration will be available in CHICKEN as an identifier ending with - foo-bar->foo-baz. That is, an underscore is converted - to a dash, '_to_' is converted to an arro, and all characters - are sent to lowercase. + Foo-Bar->Foo-Baz. That is, an underscore is converted + to a dash and '_to_' is converted to an arrow.

    @@ -143,7 +143,8 @@ specified with the -mixed option on the SWIG command line. In this mode, the above rules apply with the addition that changes in case are indications to SWIG CHICKEN to place a - dash in the CHICKEN identifier. For example, a C declartaion + dash in the CHICKEN identifier and the name is converted to lowercase. + For example, a C declartaion named someDeclaration_xyz will be available as the CHICKEN identifier ending with some-declaration-xyz. @@ -175,7 +176,7 @@ Normally, for a C declaration Foo_Bar with a module name of 'example', the corresponding CHICKEN identifier will be - example:foo-bar. The module name and a colon is + example:Foo-Bar. The module name and a colon is prefixed to the CHICKEN identifier (following normal naming conventions). @@ -201,7 +202,7 @@ In all cases, the constants may be accessed from with CHICKEN - using the form (myconstant1); that is, the constants + using the form (MYCONSTANT1); that is, the constants may be accessed using the read-only parameter form.

    @@ -296,59 +297,37 @@ -shared option if you want to create a dynamically loadable module.

    -

    - All the following examples assume that the module is named - 'example' and the following occurs when run: -

    -
    % chicken-config -home
    -CHICKEN_HOME=/usr/local/share/chicken
    -
    - Substitute /usr/local/share/chicken as appropriate for - your platform. -

    - -

    25.5.1 Customized Interpreter

    +

    25.5.1 Shared library

    - We will assume your files are in a directory - /home/jonah/examples. Make a file as follows: -

    -;; precsi.scm
    -(declare (unit precsi))
    -(declare (uses example))
    -
    -;; any other code you want run before the main interpreter is executed
    -      
    - - Run SWIG on your interface file as usual, create the 2 wrapper - object files, and then either - -
    -
    -% cd /usr/local/share/chicken
    -% chicken /usr/local/share/chicken/src/csi.scm -optimize-level 3 -quiet \
    -        -include-path /usr/local/share/chicken/src \
    -        -prologue /usr/local/share/chicken/src/build.scm \
    -        -prelude "(declare (uses posix precsi))" \
    -        -output-file /home/jonah/examples/csi-example.c
    -% cd /home/jonah/examples
    -% chicken precsi.scm -optimize-level 3 --explicit-use \
    -        -output-file precsi.c
    -% gcc precsi.c csi.c wrapper_object_files \
    -        `chicken-config -libs` `chicken-config -extra-libs` -o csi-example
    -	
    -
    -      
    - or -
    -
    % extend-csi precsi -output-file csi-example
    -
    - - + The easiest way to use SWIG and CHICKEN is to use the csc compiler + wrapper provided by CHICKEN. Assume you have a SWIG interface file + in example.i and the C functions being wrapped are in example_impl.c.

    -

    25.6 Typemaps

    +
    + $ swig -chicken example.i + $ csc -svk example.scm example_impl.c example_wrap.c + $ csi example.so test_script.scm +
    + +

    + You must be careful not to name the example_impl.c file example.c because + when compiling example.scm, csc compiles that into example.c! +

    + +

    25.5.2 Static binary

    + +

    Again, we can easily use csc to build a binary.

    + +
    + $ swig -chicken example.i + $ csc -vk example.scm example_impl.c example_wrap.c test_script.scm -o example + $ ./example +
    + +

    25.6 Typemaps

    @@ -488,7 +467,7 @@ CHICKEN_HOME=/usr/local/share/chicken

    -

    25.7 Pointers

    +

    25.7 Pointers

    @@ -521,7 +500,7 @@ CHICKEN_HOME=/usr/local/share/chicken type.

    -

    25.8 Unsupported features

    +

    25.8 Unsupported features