Help for this page

Select Code to Download


  1. or download this
    #include <stdio.h>
    #include <stdlib.h>
    ...
      int index;
      double value;
    } x_space;
    
  2. or download this
    include <stdio.h>
    #include <stdlib.h>
    ...
    void destroy_space(x_space *space){
      free(space);
    }
    
  3. or download this
    /* lib.i */
    %module libspace
    ...
    %}
    extern x_space* new_space();
    extern void destroy_space(x_space* space);
    
  4. or download this
    #!/usr/bin/perl
    use libspace;
    my $space = libspace::new_space();
    libspace::destroy_space($space);
    exit;
    
  5. or download this
    swig -perl lib.i
    g++ -Wall -Wconversion -fPIC -c -I/usr/lib/perl/5.14.2/CORE lib.c lib_
    +wrap.c
    g++ -shared lib.o lib_wrap.o -o libspace.so
    perl -I`pwd` test.pl