Skip to content

Commit 21d8388

Browse files
authored
Merge pull request #668 from RcppCore/feature/update_modules_example
Feature/update modules example
2 parents 43e53b0 + 12cabff commit 21d8388

File tree

16 files changed

+114
-19
lines changed

16 files changed

+114
-19
lines changed

ChangeLog

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
2017-04-11 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/inst/unitTests/testRcppClass/src/init.c (R_init_testRcppClass): Call
4+
R_registerRoutines() and R_useDynamicSymbols(); also ensure
5+
_rcpp_module_boot_* is registered for each module
6+
* inst/unitTests/testRcppClass/NAMESPACE: Added registration
7+
8+
* inst/unitTests/testRcppClass/DESCRIPTION (Title): Title case
9+
10+
* inst/unitTests/testRcppClass/R/rcpp_hello_world.R (rcpp_hello_world):
11+
Call the renamed C++ function
12+
* inst/unitTests/testRcppClass/src/rcpp_hello_world.cpp (rcpp_hello_world_cpp):
13+
Renamed C++ function to be distinct from R function calling it
14+
* inst/unitTests/testRcppClass/src/rcpp_hello_world.h: Ditto
15+
* inst/unitTests/testRcppClass/man/rcpp_hello_world.Rd: Alias renamed
16+
C++ function
17+
18+
2017-04-09 Dirk Eddelbuettel <edd@debian.org>
19+
20+
* inst/unitTests/testRcppModule/src/init.c (R_init_testRcppModule): Call
21+
R_registerRoutines() and R_useDynamicSymbols(); also ensure
22+
_rcpp_module_boot_* is registered for each module
23+
* inst/unitTests/testRcppModule/NAMESPACE: Added registration
24+
25+
* inst/unitTests/testRcppModule/DESCRIPTION (Title): Title case
26+
27+
* inst/unitTests/testRcppModule/R/rcpp_hello_world.R (rcpp_hello_world):
28+
Call the renamed C++ function
29+
* inst/unitTests/testRcppModule/src/rcpp_hello_world.cpp (rcpp_hello_world_cpp):
30+
Renamed C++ function to be distinct from R function calling it
31+
* inst/unitTests/testRcppModule/src/rcpp_hello_world.h: Ditto
32+
* inst/unitTests/testRcppModule/man/rcpp_hello_world.Rd: Alias renamed
33+
C++ function
34+
35+
* inst/unitTests/testRcppModule/man/Rcpp_modules_examples.Rd: Alias
36+
renamed modules
37+
* inst/unitTests/testRcppModule/tests/modules.R: Call renamed module
38+
139
2017-04-03 Jim Hester <james.f.hester@gmail.com>
240

341
* inst/include/Rcpp/exceptions.h: Added support for throwing
@@ -10,6 +48,11 @@
1048

1149
* inst/vignettes/Rcpp-FAQ.Rnw: Added "Known Issues" section to FAQ
1250

51+
2017-03-25 Dirk Eddelbuettel <edd@debian.org>
52+
53+
* LICENSE: Added
54+
* .Rbuildignore: Do not include LICENSE in package
55+
1356
2017-03-17 Dirk Eddelbuettel <edd@debian.org>
1457

1558
* DESCRIPTION: Release 0.12.10

inst/unitTests/testRcppClass/DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: testRcppClass
22
Type: Package
3-
Title: Some examples using Rcpp classes and loadModule()
3+
Title: Some Examples using Rcpp Classes and loadModule()
44
Version: 0.1
55
Date: 2012-04-06
66
Author: John Chambers
@@ -14,4 +14,4 @@ Depends: R (>= 2.15.0)
1414
Imports: Rcpp (>= 0.8.5), methods
1515
LinkingTo: Rcpp
1616
Packaged: 2012-04-14 18:42:28 UTC; jmc
17-
17+
NeedsCompilation: yes

inst/unitTests/testRcppClass/NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
useDynLib(testRcppClass)
1+
useDynLib(testRcppClass, .registration=TRUE)
22
import(Rcpp,methods)
33

44
export(genWorld, stdNumeric, rcpp_hello_world,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
rcpp_hello_world <- function(){
3-
.Call("rcpp_hello_world", PACKAGE = "testRcppClass")
3+
.Call("rcpp_hello_world_cpp", PACKAGE = "testRcppClass")
44
}
55

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include <R.h>
2+
#include <Rinternals.h>
3+
#include <stdlib.h> // for NULL
4+
#include <R_ext/Rdynload.h>
5+
6+
/* FIXME:
7+
Check these declarations against the C/Fortran source code.
8+
*/
9+
10+
/* .Call calls */
11+
extern SEXP rcpp_hello_world_cpp();
12+
extern SEXP _rcpp_module_boot_NumEx();
13+
extern SEXP _rcpp_module_boot_RcppClassModule();
14+
extern SEXP _rcpp_module_boot_stdVector();
15+
16+
static const R_CallMethodDef CallEntries[] = {
17+
{"rcpp_hello_world_cpp", (DL_FUNC) &rcpp_hello_world_cpp, 0},
18+
{"_rcpp_module_boot_NumEx", (DL_FUNC) &_rcpp_module_boot_NumEx, 0},
19+
{"_rcpp_module_boot_RcppClassModule", (DL_FUNC) &_rcpp_module_boot_RcppClassModule, 0},
20+
{"_rcpp_module_boot_stdVector", (DL_FUNC) &_rcpp_module_boot_stdVector, 0},
21+
{NULL, NULL, 0}
22+
};
23+
24+
void R_init_testRcppModule(DllInfo *dll) {
25+
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
26+
R_useDynamicSymbols(dll, FALSE);
27+
}

inst/unitTests/testRcppClass/src/rcpp_hello_world.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "rcpp_hello_world.h"
22

3-
SEXP rcpp_hello_world(){
3+
SEXP rcpp_hello_world_cpp(){
44
using namespace Rcpp ;
55

66
CharacterVector x = CharacterVector::create( "foo", "bar" ) ;

inst/unitTests/testRcppClass/src/rcpp_hello_world.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
#include <Rcpp.h>
55

6-
RcppExport SEXP rcpp_hello_world() ;
6+
RcppExport SEXP rcpp_hello_world_cpp() ;
77

88
#endif

inst/unitTests/testRcppModule/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: testRcppModule
22
Type: Package
3-
Title: Some test examples using Rcpp with the Module feature
3+
Title: Some Test Examples using Rcpp with the Module Feature
44
Version: 0.1
55
Date: 2010-09-06
66
Author: John Chambers
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
useDynLib(testRcppModule)
1+
useDynLib(testRcppModule, .registration=TRUE)
22
exportPattern("^[[:alpha:]]+")
33
import(Rcpp,methods)
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
rcpp_hello_world <- function(){
3-
.Call( "rcpp_hello_world", PACKAGE = "testRcppModule" )
3+
.Call( "rcpp_hello_world_cpp", PACKAGE = "testRcppModule" )
44
}
55

0 commit comments

Comments
 (0)