Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

G-Wrap is a tool (and guile library) for generating function wrappers for inter-language calls. It currently only supports generating Guile wrappers for C functions. Other languages may be supported in the future, possibly on both sides.

Given a definition of the types and prototypes for a given C interface, G-Wrap will automatically generate the C code that provides access to that interface and its types from the Scheme level.

To use G-Wrap, you must make sure it knows how to handle all of the C types that the functions you will be calling take as arguments and return as values, and you must also tell G-Wrap about the C prototypes of these functions. Since G-Wrap already knows about quite a few of the common C types, for many simple C APIs, you may not need to add any custom type specifications.

G-Wrap is implemented as a Guile module, and so its interface is a programmatic one. You tell G-Wrap about your functions and types, and ask it to generate wrappers for you by calling the functions exported from the (g-wrap) module.

G-Wrap heavily uses GOOPS, Guile’s object oriented extension (see GOOPS in The GNU Guile Reference Manual) . This is what makes G-Wrap highly customizable: each code generation methods may be overloaded or redefined in order to meet the user’s particular needs.

Next: , Previous: , Up: Top   [Contents][Index]