dynport {rdyncall}R Documentation

Dynamic ports to shared libraries

Description

Dynports aims to provide cross-platform portable bindings from dynamic environments to statically compiled binary components. The development is in early stage.

Usage

dynport(name, filename=NULL, repo=system.file("dynports", package="rdynall") )
loadDynportNamespace(portname)

Arguments

name A symbolic literal or character string specifying a dynport.
portname A character string specifying a dynport.

Details

The front-end function dynport dynamically links shared libraries and binds pre-compiled functions to the R run-time process and binds as an environment with thin R wrapper functions and constants. Here's a list of currently available packages:
DynPort Description Platforms
gl OpenGL 1.1 API multi-platform
glu OpenGL Utility Library multi-platform
sdl Simple Direct Layer library multi-platform
rmalloc R Memory Allocation R platforms

The Dynports Project

dynport is a new project to design a repository network of meta-informations for multi-platform binary shared library components. It is currently in incubation phase. Binding a library for scripting languages can be tedious. The dynamic binding concept of the dyncall library enables us to bind shared library code at run-time without any additional C glue code per library. When adding dyncall (and dynload) to a scripting language binding, the dynamic calling of functions is made available to the scripting language.

Under the rdyncall package directory installed in R_HOME/library/rdyncall is a sub-directory named dynports which contain dynport files for several shared libraries.

Examples



# Appetizer: SDL and OpenGL

dynport(sdl)
dynport(gl)

SDL_Init(SDL_INIT_VIDEO)
SDL_SetVideoMode(320,256,32,SDL_OPENGL+SDL_DOUBLEBUF)
glClearColor(0,0,1,0) # blue
glClear(GL_COLOR_BUFFER_BIT)
SDL_GL_SwapBuffers()


[Package rdyncall version 0.1 Index]