genRCode {RGtkBindingGenerator}R Documentation

Generate S and C interface code for a C routine

Description

These functions generate S and C code that interface to a Gtk function defined in the .defs files. These are the glue between the interactive S language and the raw Gtk method definined in the C library.

Usage

genRCode(fun, defs, name, sname, className = NULL, package = "RGtk")
genCCode(fun, defs, name) 

Arguments

fun the definition of the C routine for which we are generating either the S or C interface. This is an object of class FunctionDef that is created by reading the .defs files.
defs the collection of all the definitions read from .defs files, including classes, functions, enumerations, etc.
name the name of the C routine for which the interface is being generated.
sname the name of the S function to create.
className not used.
package the name of the S package in which the S code will be located. This is used as the value of PACKAGE argument when calling the associated C interface routine via a .GtkCall.

Value

genRCode returns string giving the full definition of the S function that interfaces to the C routine. This includes the assignment to the appropriate function name. genCCode returns a list with two elements:

code a string giving the full definition of the S-C interface routine that interfaces to the underlying C routine. This can be put into a .c file, compiled and accessed from S via .GtkCall.
decl a string giving the declaration of the S-C interface routine which can be used in a header file (.h). This can be used when creating the registration table of routines in the generated package.

Author(s)

Duncan Temple Lang <duncan@research.bell-labs.com>

References

http://www.omegahat.org/RGtk, http://www.omegahat.org/RGtkBindingGenerator, http://www.gtk.org http://www.pygtk.org(?)

See Also

genCode generateCodeFiles

Examples



[Package RGtkBindingGenerator version 0.3 Index]