[Rinside-commits] r157 - / deprecated pkg pkg/R pkg/inst/include pkg/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jun 15 17:44:46 CEST 2010
Author: romain
Date: 2010-06-15 17:44:45 +0200 (Tue, 15 Jun 2010)
New Revision: 157
Added:
deprecated/
deprecated/Makefile
deprecated/Makefile.win
pkg/inst/include/Callbacks.h
pkg/inst/include/MemBuf.h
pkg/inst/include/RInside.h
pkg/inst/include/RInsideCommon.h
pkg/inst/include/RInsideConfig.h
pkg/src/Makevars
Removed:
pkg/src/Callbacks.h
pkg/src/Makefile
pkg/src/Makefile.win
pkg/src/MemBuf.h
pkg/src/RInside.h
pkg/src/RInsideCommon.h
pkg/src/RInsideConfig.h
Modified:
pkg/DESCRIPTION
pkg/R/RInsidePaths.R
pkg/src/MemBuf.cpp
pkg/src/RInside.cpp
Log:
first pass at using a Makevars instead of a Makefile, Makevars.win will follow
Added: deprecated/Makefile
===================================================================
--- deprecated/Makefile (rev 0)
+++ deprecated/Makefile 2010-06-15 15:44:45 UTC (rev 157)
@@ -0,0 +1,82 @@
+## Simple Makefile
+##
+## R/C++ interface class library -- Easier R embedding into C++
+##
+## Copyright (C) 2009 Dirk Eddelbuettel
+## Copyright (C) 2009 - 2010 Dirk Eddelbuettel and Romain Francois
+##
+## This file is part of RInside.
+##
+## RInside is free software: you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 2 of the License, or
+## (at your option) any later version.
+##
+## RInside is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with RInside. If not, see <http://www.gnu.org/licenses/>.
+##
+## Assumptions:
+## This Makefile is inside the src/ directory of the RInside
+## package and should only be called by R via 'R CMD INSTALL'
+## 'R CMD build', 'R CMD check' etc. Thus we can assume R_HOME
+## below which should be all that is needed to support several
+## R installations at the same time.
+
+SOURCES := $(wildcard *.cpp)
+OBJECTS := $(SOURCES:.cpp=.o)
+
+
+HEADERS := RInsideEnvVars.h RInsideAutoloads.h
+
+USERLIB = libRInside$(DYLIB_EXT)
+USERLIBST = libRInside.a
+USERDIR = ../inst/lib
+
+RCPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflags)
+RLDFLAGS := $(shell $(R_HOME)/bin/R CMD config --ldflags)
+
+RCPPINCL := $(shell echo 'Rcpp:::CxxFlags()' | $(R_HOME)/bin/R --vanilla --slave)
+
+CXX := $(shell $(R_HOME)/bin/R CMD config CXX)
+CPPFLAGS := $(RCPPFLAGS) $(RCPPINCL)
+CXXFLAGS := -I. $(RCPPFLAGS) $(shell $(R_HOME)/bin/R CMD config CXXFLAGS)
+LDFLAGS = -s
+LDLIBS = $(RLDFLAGS)
+
+
+all : $(SHLIB) userLibrary
+
+.PHONY : RInsideEnvVars.h
+RInsideEnvVars.h : tools/RInsideEnvVars.r
+ $(R_HOME)/bin/R --vanilla --slave < tools/RInsideEnvVars.r > RInsideEnvVars.h
+
+.PHONY : RInsideAutoloads.h
+RInsideAutoloads.h : tools/RInsideAutoloads.r
+ $(R_HOME)/bin/R --vanilla --slave < tools/RInsideAutoloads.r > RInsideAutoloads.h
+
+userLibrary : $(USERLIB) $(USERLIBST)
+ - at if test ! -e $(USERDIR)$(R_ARCH); then mkdir -p $(USERDIR)$(R_ARCH); fi
+ cp $(USERLIB) $(USERDIR)$(R_ARCH)
+ cp RInside.h MemBuf.h RInsideCommon.h RInsideConfig.h Callbacks.h $(USERDIR)$(R_ARCH)
+ cp $(USERLIBST) $(USERDIR)$(R_ARCH)
+ rm $(USERLIB) $(USERLIBST)
+
+$(USERLIB) : $(HEADERS) $(OBJECTS)
+ $(SHLIB_CXXLD) -o $(USERLIB) $(OBJECTS) $(SHLIB_CXXLDFLAGS) $(ALL_LIBS)
+ @if test -e "/usr/bin/install_name_tool"; then \
+ /usr/bin/install_name_tool -id $(R_PACKAGE_DIR)/lib$(R_ARCH)/$(USERLIB) $(USERLIB); fi
+
+$(USERLIBST) : $(HEADERS) $(OBJECTS)
+ $(AR) qc $(USERLIBST) $(OBJECTS)
+ @if test -n "$(RANLIB)"; then $(RANLIB) $(USERLIBST); fi
+
+.PHONY : all clean userLibrary
+
+clean:
+ rm -f $(OBJECTS) $(SHLIB) $(USERLIB) $(USERLIBST) $(HEADERS)
+
Added: deprecated/Makefile.win
===================================================================
--- deprecated/Makefile.win (rev 0)
+++ deprecated/Makefile.win 2010-06-15 15:44:45 UTC (rev 157)
@@ -0,0 +1,85 @@
+## -*- mode: makefile; tab-width: 8; -*-
+##
+## R/C++ interface class library -- Easier R embedding into C++
+##
+## Copyright (C) 2009 - 2010 Dirk Eddelbuettel
+##
+## This file is part of RInside.
+##
+## RInside is free software: you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 2 of the License, or
+## (at your option) any later version.
+##
+## RInside is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with RInside. If not, see <http://www.gnu.org/licenses/>.
+##
+## Assumptions:
+## This Makefile is inside the src/ directory of the RInside
+## package and should only be called by R via 'R CMD INSTALL'
+## 'R CMD build', 'R CMD check' etc. Thus we can assume R_HOME
+## below which should be all that is needed to support several
+## R installations at the same time.
+
+include $(R_HOME)/etc$(R_ARCH)/Makeconf
+
+SOURCES := $(wildcard *.cpp)
+OBJECTS := $(SOURCES:.cpp=.o)
+
+HEADERS := RInsideEnvVars.h RInsideAutoloads.h
+
+USERLIB = libRInside.dll
+USERLIBST = libRInside.a
+USERDIR = ../inst/lib
+
+RCPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflags)
+RLDFLAGS := $(shell $(R_HOME)/bin/R CMD config --ldflags)
+
+RCPPINCL := $(shell echo 'Rcpp:::CxxFlags()' | $(R_HOME)/bin/R --vanilla --slave)
+RCPPLIB := $(shell echo 'Rcpp:::LdFlags()' | $(R_HOME)/bin/R --vanilla --slave)
+
+CXX := $(shell $(R_HOME)/bin/R CMD config CXX)
+CPPFLAGS := -Wall $(shell $(R_HOME)/bin/R CMD config CPPFLAGS)
+CXXFLAGS := -I. $(RCPPFLAGS) $(RCPPINCL) $(shell $(R_HOME)/bin/R CMD config CXXFLAGS)
+LDFLAGS = -s
+LDLIBS = $(RLDFLAGS) -L(R_HOME)/bin/R.dll
+
+
+all : $(SHLIB) userLibrary
+
+.PHONY : RInsideEnvVars.h
+RInsideEnvVars.h : tools/RInsideEnvVars.r
+ $(R_HOME)/bin/R --vanilla --slave < tools/RInsideEnvVars.r > RInsideEnvVars.h
+ $(R_HOME)/bin/Rscript tools/unix2dos.r RInsideEnvVars.h
+
+.PHONY : RInsideAutoloads.h
+RInsideAutoloads.h : tools/RInsideAutoloads.r
+ $(R_HOME)/bin/R --vanilla --slave < tools/RInsideAutoloads.r > RInsideAutoloads.h
+ $(R_HOME)/bin/Rscript tools/unix2dos.r RInsideAutoloads.h
+
+userLibrary : $(USERLIB) $(USERLIBST)
+ - at if test ! -e $(USERDIR); then mkdir -p $(USERDIR); fi
+ cp $(USERLIB) $(USERDIR)
+ cp RInside.h MemBuf.h RInsideCommon.h RInsideConfig.h Callbacks.h $(USERDIR)
+ cp $(USERLIBST) $(USERDIR)
+ rm $(USERLIB) $(USERLIBST)
+
+$(USERLIB) : $(HEADERS) $(OBJECTS)
+ $(CXX) -Wl,--export-all-symbols -shared -o $(USERLIB) $(OBJECTS) $(RCPPLIB) $(RLDFLAGS) $(ALL_LIBS) -lws2_32
+ @if test -e "/usr/bin/install_name_tool"; then \
+ /usr/bin/install_name_tool -id $(R_PACKAGE_DIR)/lib$(R_ARCH)/$(USERLIB) $(USERLIB); fi
+
+$(USERLIBST) : $(HEADERS) $(OBJECTS)
+ $(AR) qc $(USERLIBST) $(OBJECTS)
+ @if test -n "$(RANLIB)"; then $(RANLIB) $(USERLIBST); fi
+
+.PHONY : all clean userLibrary
+
+clean:
+ rm -f $(OBJECTS) $(SHLIB) $(USERLIB) $(USERLIBST) $(HEADERS)
+
Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION 2010-06-15 14:03:12 UTC (rev 156)
+++ pkg/DESCRIPTION 2010-06-15 15:44:45 UTC (rev 157)
@@ -15,7 +15,8 @@
Several examples are provided below the examples/ directory of
the installed package, and Doxygen-generated documentation of
the C++ classes is included as well.
-Depends: R (>= 2.10.0), Rcpp (>= 0.7.10)
+Depends: R (>= 2.10.0), Rcpp (>= 0.8.2)
+LinkingTo: Rcpp
SystemRequirements: None
URL: http://dirk.eddelbuettel.com/code/rinside.html
License: GPL (>= 2)
Modified: pkg/R/RInsidePaths.R
===================================================================
--- pkg/R/RInsidePaths.R 2010-06-15 14:03:12 UTC (rev 156)
+++ pkg/R/RInsidePaths.R 2010-06-15 15:44:45 UTC (rev 157)
@@ -36,12 +36,12 @@
## Provide compiler flags -- i.e. -I/path/to/RInside.h
RInsideCxxFlags <- function() {
- path <- RInsideLdPath()
- if (.Platform$OS.type=="windows") {
- path <- shQuote(path)
- }
- paste("-I", path, sep="")
-}
+ path <- system.file( "include", package = "RInside" )
+ # if (.Platform$OS.type=="windows") {
+ # path <- shQuote(path)
+ # }
+ sprintf('-I"%s"', path)
+}
## Shorter names, and call cat() directly
CxxFlags <- function() {
Copied: pkg/inst/include/Callbacks.h (from rev 153, pkg/src/Callbacks.h)
===================================================================
--- pkg/inst/include/Callbacks.h (rev 0)
+++ pkg/inst/include/Callbacks.h 2010-06-15 15:44:45 UTC (rev 157)
@@ -0,0 +1,70 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// Callbacks.h: R/C++ interface class library -- Easier R embedding into C++
+//
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of RInside.
+//
+// RInside is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// RInside is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with RInside. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef RINSIDE_CALLBACKS_H
+#define RINSIDE_CALLBACKS_H
+
+#include <RInsideCommon.h>
+
+#ifdef RINSIDE_CALLBACKS
+
+class Callbacks {
+public:
+
+ Callbacks() : R_is_busy(false), buffer() {} ;
+ virtual ~Callbacks(){} ;
+
+ virtual void ShowMessage(const char* message) {} ;
+ virtual void Suicide(const char* message) {};
+ virtual std::string ReadConsole( const char* prompt, bool addtohistory ) { return ""; };
+ virtual void WriteConsole( const std::string& line, int type ) {};
+ virtual void FlushConsole() {};
+ virtual void ResetConsole() {};
+ virtual void CleanerrConsole(){} ;
+ virtual void Busy( bool is_busy ) {} ;
+
+ void Busy_( int which ) ;
+ int ReadConsole_( const char* prompt, unsigned char* buf, int len, int addtohistory ) ;
+ void WriteConsole_( const char* buf, int len, int oType ) ;
+
+ // TODO: ShowFiles
+ // TODO: ChooseFile
+ // TODO: loadHistory
+ // TODO: SaveHistory
+
+ virtual bool has_ShowMessage() { return false ; } ;
+ virtual bool has_Suicide() { return false ; } ;
+ virtual bool has_ReadConsole() { return false ; } ;
+ virtual bool has_WriteConsole() { return false ; } ;
+ virtual bool has_ResetConsole() { return false ; } ;
+ virtual bool has_CleanerrConsole() { return false ; } ;
+ virtual bool has_Busy() { return false ; } ;
+ virtual bool has_FlushConsole(){ return false; } ;
+
+private:
+ bool R_is_busy ;
+ std::string buffer ;
+
+} ;
+
+#endif
+
+#endif
Copied: pkg/inst/include/MemBuf.h (from rev 153, pkg/src/MemBuf.h)
===================================================================
--- pkg/inst/include/MemBuf.h (rev 0)
+++ pkg/inst/include/MemBuf.h 2010-06-15 15:44:45 UTC (rev 157)
@@ -0,0 +1,34 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// MemBuf.h: R/C++ interface class library -- Easier R embedding into C++
+//
+// Copyright (C) 2009 Dirk Eddelbuettel
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of RInside.
+//
+// RInside is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// RInside is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with RInside. If not, see <http://www.gnu.org/licenses/>.
+
+class MemBuf { // simple C++-ification of littler's membuf
+private:
+ std::string buffer ;
+
+public:
+ MemBuf(int sizebytes=1024);
+ ~MemBuf();
+ void resize();
+ void rewind();
+ void add(char *buf);
+ const char* getBufPtr() { return buffer.c_str() ; };
+};
Copied: pkg/inst/include/RInside.h (from rev 153, pkg/src/RInside.h)
===================================================================
--- pkg/inst/include/RInside.h (rev 0)
+++ pkg/inst/include/RInside.h 2010-06-15 15:44:45 UTC (rev 157)
@@ -0,0 +1,93 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// RInside.h: R/C++ interface class library -- Easier R embedding into C++
+//
+// Copyright (C) 2009 Dirk Eddelbuettel
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of RInside.
+//
+// RInside is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// RInside is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with RInside. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef RINSIDE_RINSIDE_H
+#define RINSIDE_RINSIDE_H
+
+#include <RInsideCommon.h>
+#include <Callbacks.h>
+
+class RInside {
+private:
+ MemBuf mb_m;
+ Rcpp::Environment global_env ;
+
+ bool verbose_m; // private switch
+
+ void init_tempdir(void);
+ void init_rand(void);
+ void autoloads(void);
+
+ void initialize(const int argc, const char* const argv[] ) ;
+
+ static RInside* instance_ ;
+
+#ifdef RINSIDE_CALLBACKS
+ Callbacks* callbacks ;
+ friend void RInside_ShowMessage( const char* message) ;
+ friend void RInside_WriteConsoleEx( const char* message, int len, int oType ) ;
+ friend int RInside_ReadConsole(const char *prompt, unsigned char *buf, int len, int addtohistory) ;
+ friend void RInside_ResetConsole() ;
+ friend void RInside_FlushConsole() ;
+ friend void RInside_ClearerrConsole() ;
+ friend void RInside_Busy(int which) ;
+#endif
+
+public:
+ int parseEval(const std::string & line, SEXP &ans); // parse line, return in ans; error code rc
+ void parseEvalQ(const std::string & line); // parse line, no return (throws on error)
+
+ class Proxy {
+ public:
+ Proxy(SEXP xx): x(xx) { };
+
+ template <typename T>
+ operator T() {
+ return ::Rcpp::as<T>(x);
+ }
+ private:
+ Rcpp::RObject x;
+ };
+
+ Proxy parseEval(const std::string & line); // parse line, return SEXP (throws on error)
+
+ template <typename T>
+ void assign(const T& object, const std::string& nam) {
+ global_env.assign( nam, object ) ;
+ }
+
+ RInside() ;
+ RInside(const int argc, const char* const argv[]);
+ ~RInside();
+
+ Rcpp::Environment::Binding operator[]( const std::string& name ) ;
+
+ static RInside& instance() ;
+
+#ifdef RINSIDE_CALLBACKS
+ void set_callbacks(Callbacks* callbacks_) ;
+ void repl() ;
+#endif
+
+};
+
+#endif
Copied: pkg/inst/include/RInsideCommon.h (from rev 153, pkg/src/RInsideCommon.h)
===================================================================
--- pkg/inst/include/RInsideCommon.h (rev 0)
+++ pkg/inst/include/RInsideCommon.h 2010-06-15 15:44:45 UTC (rev 157)
@@ -0,0 +1,53 @@
+// RInsideCommon.h: R/C++ interface class library -- Easier R embedding into C++
+//
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of RInside.
+//
+// RInside is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// RInside is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with RInside. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef RINSIDE_RINSIDECOMMON_H
+#define RINSIDE_RINSIDECOMMON_H
+
+#include <RInsideConfig.h>
+
+#include <string>
+#include <vector>
+#include <iostream>
+
+#include <Rcpp.h>
+
+#include <Rembedded.h>
+#ifndef WIN32
+#define R_INTERFACE_PTRS
+#include <Rinterface.h>
+#endif
+#include <R_ext/RStartup.h>
+
+#include <MemBuf.h>
+
+// simple logging help
+inline void logTxtFunction(const char* file, const int line, const char* expression, const bool verbose) {
+ if (verbose) {
+ std::cout << file << ":" << line << " expression: " << expression << std::endl;
+ }
+}
+
+#ifdef logTxt
+#undef logTxt
+#endif
+//#define logTxt(x, b) logTxtFunction(__FILE__, __LINE__, x, b);
+#define logTxt(x, b)
+
+#endif
Copied: pkg/inst/include/RInsideConfig.h (from rev 153, pkg/src/RInsideConfig.h)
===================================================================
--- pkg/inst/include/RInsideConfig.h (rev 0)
+++ pkg/inst/include/RInsideConfig.h 2010-06-15 15:44:45 UTC (rev 157)
@@ -0,0 +1,26 @@
+// RInsideConfig.h: R/C++ interface class library -- Easier R embedding into C++
+//
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of RInside.
+//
+// RInside is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// RInside is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with RInside. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef RINSIDE_RINSIDECONFIG_H
+#define RINSIDE_RINSIDECONFIG_H
+
+// uncomment to turn on the experimental callbacks
+// #define RINSIDE_CALLBACKS
+
+#endif
Deleted: pkg/src/Callbacks.h
===================================================================
--- pkg/src/Callbacks.h 2010-06-15 14:03:12 UTC (rev 156)
+++ pkg/src/Callbacks.h 2010-06-15 15:44:45 UTC (rev 157)
@@ -1,70 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// Callbacks.h: R/C++ interface class library -- Easier R embedding into C++
-//
-// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
-//
-// This file is part of RInside.
-//
-// RInside is free software: you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 2 of the License, or
-// (at your option) any later version.
-//
-// RInside is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with RInside. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef RINSIDE_CALLBACKS_H
-#define RINSIDE_CALLBACKS_H
-
-#include "RInsideCommon.h"
-
-#ifdef RINSIDE_CALLBACKS
-
-class Callbacks {
-public:
-
- Callbacks() : R_is_busy(false), buffer() {} ;
- virtual ~Callbacks(){} ;
-
- virtual void ShowMessage(const char* message) {} ;
- virtual void Suicide(const char* message) {};
- virtual std::string ReadConsole( const char* prompt, bool addtohistory ) { return ""; };
- virtual void WriteConsole( const std::string& line, int type ) {};
- virtual void FlushConsole() {};
- virtual void ResetConsole() {};
- virtual void CleanerrConsole(){} ;
- virtual void Busy( bool is_busy ) {} ;
-
- void Busy_( int which ) ;
- int ReadConsole_( const char* prompt, unsigned char* buf, int len, int addtohistory ) ;
- void WriteConsole_( const char* buf, int len, int oType ) ;
-
- // TODO: ShowFiles
- // TODO: ChooseFile
- // TODO: loadHistory
- // TODO: SaveHistory
-
- virtual bool has_ShowMessage() { return false ; } ;
- virtual bool has_Suicide() { return false ; } ;
- virtual bool has_ReadConsole() { return false ; } ;
- virtual bool has_WriteConsole() { return false ; } ;
- virtual bool has_ResetConsole() { return false ; } ;
- virtual bool has_CleanerrConsole() { return false ; } ;
- virtual bool has_Busy() { return false ; } ;
- virtual bool has_FlushConsole(){ return false; } ;
-
-private:
- bool R_is_busy ;
- std::string buffer ;
-
-} ;
-
-#endif
-
-#endif
Deleted: pkg/src/Makefile
===================================================================
--- pkg/src/Makefile 2010-06-15 14:03:12 UTC (rev 156)
+++ pkg/src/Makefile 2010-06-15 15:44:45 UTC (rev 157)
@@ -1,82 +0,0 @@
-## Simple Makefile
-##
-## R/C++ interface class library -- Easier R embedding into C++
-##
-## Copyright (C) 2009 Dirk Eddelbuettel
-## Copyright (C) 2009 - 2010 Dirk Eddelbuettel and Romain Francois
-##
-## This file is part of RInside.
-##
-## RInside is free software: you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by
-## the Free Software Foundation, either version 2 of the License, or
-## (at your option) any later version.
-##
-## RInside is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with RInside. If not, see <http://www.gnu.org/licenses/>.
-##
-## Assumptions:
-## This Makefile is inside the src/ directory of the RInside
-## package and should only be called by R via 'R CMD INSTALL'
-## 'R CMD build', 'R CMD check' etc. Thus we can assume R_HOME
-## below which should be all that is needed to support several
-## R installations at the same time.
-
-SOURCES := $(wildcard *.cpp)
-OBJECTS := $(SOURCES:.cpp=.o)
-
-
-HEADERS := RInsideEnvVars.h RInsideAutoloads.h
-
-USERLIB = libRInside$(DYLIB_EXT)
-USERLIBST = libRInside.a
-USERDIR = ../inst/lib
-
-RCPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflags)
-RLDFLAGS := $(shell $(R_HOME)/bin/R CMD config --ldflags)
-
-RCPPINCL := $(shell echo 'Rcpp:::CxxFlags()' | $(R_HOME)/bin/R --vanilla --slave)
-
-CXX := $(shell $(R_HOME)/bin/R CMD config CXX)
-CPPFLAGS := $(RCPPFLAGS) $(RCPPINCL)
-CXXFLAGS := -I. $(RCPPFLAGS) $(shell $(R_HOME)/bin/R CMD config CXXFLAGS)
-LDFLAGS = -s
-LDLIBS = $(RLDFLAGS)
-
-
-all : $(SHLIB) userLibrary
-
-.PHONY : RInsideEnvVars.h
-RInsideEnvVars.h : tools/RInsideEnvVars.r
- $(R_HOME)/bin/R --vanilla --slave < tools/RInsideEnvVars.r > RInsideEnvVars.h
-
-.PHONY : RInsideAutoloads.h
-RInsideAutoloads.h : tools/RInsideAutoloads.r
- $(R_HOME)/bin/R --vanilla --slave < tools/RInsideAutoloads.r > RInsideAutoloads.h
-
-userLibrary : $(USERLIB) $(USERLIBST)
- - at if test ! -e $(USERDIR)$(R_ARCH); then mkdir -p $(USERDIR)$(R_ARCH); fi
- cp $(USERLIB) $(USERDIR)$(R_ARCH)
- cp RInside.h MemBuf.h RInsideCommon.h RInsideConfig.h Callbacks.h $(USERDIR)$(R_ARCH)
- cp $(USERLIBST) $(USERDIR)$(R_ARCH)
- rm $(USERLIB) $(USERLIBST)
-
-$(USERLIB) : $(HEADERS) $(OBJECTS)
- $(SHLIB_CXXLD) -o $(USERLIB) $(OBJECTS) $(SHLIB_CXXLDFLAGS) $(ALL_LIBS)
- @if test -e "/usr/bin/install_name_tool"; then \
- /usr/bin/install_name_tool -id $(R_PACKAGE_DIR)/lib$(R_ARCH)/$(USERLIB) $(USERLIB); fi
-
-$(USERLIBST) : $(HEADERS) $(OBJECTS)
- $(AR) qc $(USERLIBST) $(OBJECTS)
- @if test -n "$(RANLIB)"; then $(RANLIB) $(USERLIBST); fi
-
-.PHONY : all clean userLibrary
-
-clean:
- rm -f $(OBJECTS) $(SHLIB) $(USERLIB) $(USERLIBST) $(HEADERS)
-
Deleted: pkg/src/Makefile.win
===================================================================
--- pkg/src/Makefile.win 2010-06-15 14:03:12 UTC (rev 156)
+++ pkg/src/Makefile.win 2010-06-15 15:44:45 UTC (rev 157)
@@ -1,85 +0,0 @@
-## -*- mode: makefile; tab-width: 8; -*-
-##
-## R/C++ interface class library -- Easier R embedding into C++
-##
-## Copyright (C) 2009 - 2010 Dirk Eddelbuettel
-##
-## This file is part of RInside.
-##
-## RInside is free software: you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by
-## the Free Software Foundation, either version 2 of the License, or
-## (at your option) any later version.
-##
-## RInside is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with RInside. If not, see <http://www.gnu.org/licenses/>.
-##
-## Assumptions:
-## This Makefile is inside the src/ directory of the RInside
-## package and should only be called by R via 'R CMD INSTALL'
-## 'R CMD build', 'R CMD check' etc. Thus we can assume R_HOME
-## below which should be all that is needed to support several
-## R installations at the same time.
-
-include $(R_HOME)/etc$(R_ARCH)/Makeconf
-
-SOURCES := $(wildcard *.cpp)
-OBJECTS := $(SOURCES:.cpp=.o)
-
-HEADERS := RInsideEnvVars.h RInsideAutoloads.h
-
-USERLIB = libRInside.dll
-USERLIBST = libRInside.a
-USERDIR = ../inst/lib
-
-RCPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflags)
-RLDFLAGS := $(shell $(R_HOME)/bin/R CMD config --ldflags)
-
-RCPPINCL := $(shell echo 'Rcpp:::CxxFlags()' | $(R_HOME)/bin/R --vanilla --slave)
-RCPPLIB := $(shell echo 'Rcpp:::LdFlags()' | $(R_HOME)/bin/R --vanilla --slave)
-
-CXX := $(shell $(R_HOME)/bin/R CMD config CXX)
-CPPFLAGS := -Wall $(shell $(R_HOME)/bin/R CMD config CPPFLAGS)
-CXXFLAGS := -I. $(RCPPFLAGS) $(RCPPINCL) $(shell $(R_HOME)/bin/R CMD config CXXFLAGS)
-LDFLAGS = -s
-LDLIBS = $(RLDFLAGS) -L(R_HOME)/bin/R.dll
-
-
-all : $(SHLIB) userLibrary
-
-.PHONY : RInsideEnvVars.h
-RInsideEnvVars.h : tools/RInsideEnvVars.r
- $(R_HOME)/bin/R --vanilla --slave < tools/RInsideEnvVars.r > RInsideEnvVars.h
- $(R_HOME)/bin/Rscript tools/unix2dos.r RInsideEnvVars.h
-
-.PHONY : RInsideAutoloads.h
-RInsideAutoloads.h : tools/RInsideAutoloads.r
- $(R_HOME)/bin/R --vanilla --slave < tools/RInsideAutoloads.r > RInsideAutoloads.h
- $(R_HOME)/bin/Rscript tools/unix2dos.r RInsideAutoloads.h
-
-userLibrary : $(USERLIB) $(USERLIBST)
- - at if test ! -e $(USERDIR); then mkdir -p $(USERDIR); fi
- cp $(USERLIB) $(USERDIR)
- cp RInside.h MemBuf.h RInsideCommon.h RInsideConfig.h Callbacks.h $(USERDIR)
- cp $(USERLIBST) $(USERDIR)
- rm $(USERLIB) $(USERLIBST)
-
-$(USERLIB) : $(HEADERS) $(OBJECTS)
- $(CXX) -Wl,--export-all-symbols -shared -o $(USERLIB) $(OBJECTS) $(RCPPLIB) $(RLDFLAGS) $(ALL_LIBS) -lws2_32
- @if test -e "/usr/bin/install_name_tool"; then \
- /usr/bin/install_name_tool -id $(R_PACKAGE_DIR)/lib$(R_ARCH)/$(USERLIB) $(USERLIB); fi
-
-$(USERLIBST) : $(HEADERS) $(OBJECTS)
- $(AR) qc $(USERLIBST) $(OBJECTS)
- @if test -n "$(RANLIB)"; then $(RANLIB) $(USERLIBST); fi
-
-.PHONY : all clean userLibrary
-
-clean:
- rm -f $(OBJECTS) $(SHLIB) $(USERLIB) $(USERLIBST) $(HEADERS)
-
Added: pkg/src/Makevars
===================================================================
--- pkg/src/Makevars (rev 0)
+++ pkg/src/Makevars 2010-06-15 15:44:45 UTC (rev 157)
@@ -0,0 +1,45 @@
+## Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+##
+## This file is part of RInside.
+##
+## RInside is free software: you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 2 of the License, or
+## (at your option) any later version.
+##
+## RInside is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with RInside. If not, see <http://www.gnu.org/licenses/>.
+
+USERLIB=libRInside$(DYLIB_EXT)
+USERLIBST=libRInside.a
+USERDIR=../inst/lib
+
+PKG_CPPFLAGS += -I../inst/include/
+PKG_LIBS = $(shell $(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()" )
+
+all: $(SHLIB) userLibrary
+
+userLibrary: $(USERLIB) $(USERLIBST)
+ - at if test ! -e $(USERDIR)$(R_ARCH); then mkdir -p $(USERDIR)$(R_ARCH); fi
+ cp $(USERLIB) $(USERDIR)$(R_ARCH)
+ cp $(USERLIBST) $(USERDIR)$(R_ARCH)
+ rm $(USERLIB) $(USERLIBST)
+
+$(USERLIB): $(OBJECTS)
+ $(SHLIB_CXXLD) -o $(USERLIB) $^ $(SHLIB_CXXLDFLAGS) $(ALL_LIBS)
+ @if test -e "/usr/bin/install_name_tool"; then /usr/bin/install_name_tool -id $(R_PACKAGE_DIR)/lib$(R_ARCH)/$(USERLIB) $(USERLIB); fi
+
+$(USERLIBST): $(OBJECTS)
+ $(AR) qc $(USERLIBST) $^
+ @if test -n "$(RANLIB)"; then $(RANLIB) $(USERLIBST); fi
+
+.PHONY: all clean userLibrary
+
+clean:
+ rm -f $(OBJECTS) $(SHLIB) $(USERLIB) $(USERLIBST)
+
Modified: pkg/src/MemBuf.cpp
===================================================================
--- pkg/src/MemBuf.cpp 2010-06-15 14:03:12 UTC (rev 156)
+++ pkg/src/MemBuf.cpp 2010-06-15 15:44:45 UTC (rev 157)
@@ -24,7 +24,7 @@
#include <cstring>
#include <string.h> // Solaris seems to need this for strlen
-#include "MemBuf.h"
+#include <MemBuf.h>
extern bool verbose;
extern const char *programName;
Deleted: pkg/src/MemBuf.h
===================================================================
--- pkg/src/MemBuf.h 2010-06-15 14:03:12 UTC (rev 156)
+++ pkg/src/MemBuf.h 2010-06-15 15:44:45 UTC (rev 157)
@@ -1,34 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// MemBuf.h: R/C++ interface class library -- Easier R embedding into C++
-//
-// Copyright (C) 2009 Dirk Eddelbuettel
-// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
-//
-// This file is part of RInside.
-//
-// RInside is free software: you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 2 of the License, or
-// (at your option) any later version.
-//
-// RInside is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with RInside. If not, see <http://www.gnu.org/licenses/>.
-
-class MemBuf { // simple C++-ification of littler's membuf
-private:
- std::string buffer ;
-
-public:
- MemBuf(int sizebytes=1024);
- ~MemBuf();
- void resize();
- void rewind();
- void add(char *buf);
- const char* getBufPtr() { return buffer.c_str() ; };
-};
Modified: pkg/src/RInside.cpp
===================================================================
--- pkg/src/RInside.cpp 2010-06-15 14:03:12 UTC (rev 156)
+++ pkg/src/RInside.cpp 2010-06-15 15:44:45 UTC (rev 157)
@@ -20,8 +20,8 @@
// You should have received a copy of the GNU General Public License
// along with RInside. If not, see <http://www.gnu.org/licenses/>.
-#include "RInside.h"
-#include "Callbacks.h"
+#include <RInside.h>
+#include <Callbacks.h>
RInside* RInside::instance_ = 0 ;
@@ -79,7 +79,7 @@
verbose_m = false; // Default is false
// generated as littler.h via from svn/littler/littler.R
- #include "RInsideEnvVars.h"
+ #include <RInsideEnvVars.h>
for (int i = 0; R_VARS[i] != NULL; i+= 2) {
if (getenv(R_VARS[i]) == NULL) { // if env variable is not yet set
@@ -162,7 +162,7 @@
void RInside::autoloads() {
- #include "RInsideAutoloads.h"
+ #include <RInsideAutoloads.h>
// Autoload default packages and names from autoloads.h
//
Deleted: pkg/src/RInside.h
===================================================================
--- pkg/src/RInside.h 2010-06-15 14:03:12 UTC (rev 156)
+++ pkg/src/RInside.h 2010-06-15 15:44:45 UTC (rev 157)
@@ -1,93 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// RInside.h: R/C++ interface class library -- Easier R embedding into C++
-//
-// Copyright (C) 2009 Dirk Eddelbuettel
-// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
-//
-// This file is part of RInside.
-//
-// RInside is free software: you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/rinside -r 157
More information about the Rinside-commits
mailing list