Rev 42961 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/converters.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2007 R Core Development Team% Distributed under GPL 2 or later\name{getNumCConverters}\alias{getNumCConverters}\alias{getCConverterDescriptions}\alias{getCConverterStatus}\alias{setCConverterStatus}\alias{removeCConverter}\title{Management of .C argument conversion list}\description{These functions provide facilities to manage the extensiblelist of converters used to translate R objects to Cpointers for use in \code{\link{.C}} calls.The number and a description of each element in the listcan be retrieved. One can also query and set the activitystatus of individual elements, temporarily ignoring them.And one can remove individual elements.}\usage{getNumCConverters()getCConverterDescriptions()getCConverterStatus()setCConverterStatus(id, status)removeCConverter(id)}\arguments{\item{id}{either a number or a string identifying the element of interest in the converterlist. A string is matched against the description strings for each element to identifythe element. Integers are specified starting at 1 (rather than 0).}\item{status}{a logical value specifying whether the element is to be consideredactive (\code{TRUE}) or not (\code{FALSE}).}}\details{The internal list of converters is potentially used when convertingindividual arguments in a \code{\link{.C}} call. If an argument has anon-trivial class attribute, we iterate over the list of converterslooking for the first that matches. If we find a matchingconverter, we have it create the C-level pointer corresponding to theR object. When the call to the C routine is complete, we use the sameconverter for that argument to reverse the conversion and create an Robject from the current value in the C pointer. This is doneseparately for all the arguments.The functions documented here provide \R user-level capabilitiesfor investigating and managing the list of converters.There is currently no mechanism for adding an element to theconverter list within the \R language. This must be done inC code using the routine \code{R_addToCConverter()}.}\value{\code{getNumCConverters} returns an integer giving the numberof elements in the list, both active and inactive.\code{getCConverterDescriptions} returns a character vector containingthe description string of each element of the converter list.\code{getCConverterStatus} returns a logical vector with a value foreach element in the converter list. Each value indicates whether thatconverter is active (\code{TRUE}) or inactive (\code{FALSE}).The names of the elements are the description strings returnedby \code{getCConverterDescriptions}.\code{setCConverterStatus} returns the logical value indicating theactivity status of the specified element before the call to change ittook effect. This is \code{TRUE} for active and \code{FALSE} forinactive.\code{removeCConverter} returns \code{TRUE} ifan element in the converter list was identified and removed.In the case that no such element was found, an error occurs.}\references{\url{http://developer.R-project.org/CObjectConversion.pdf}}\author{Duncan Temple Lang}\seealso{\code{\link{.C}}}\examples{getNumCConverters()getCConverterDescriptions()getCConverterStatus()\dontrun{old <- setCConverterStatus(1, FALSE)setCConverterStatus(1, old)}\dontrun{removeCConverter(1)removeCConverter(getCConverterDescriptions()[1])}}\keyword{interface}\keyword{programming}