[Xts-commits] r758 - pkg/xts/inst/include

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 17 03:27:41 CET 2013


Author: edd
Date: 2013-01-17 03:27:40 +0100 (Thu, 17 Jan 2013)
New Revision: 758

Added:
   pkg/xts/inst/include/xtsAPI.h
Modified:
   pkg/xts/inst/include/xts.h
   pkg/xts/inst/include/xts_stubs.c
Log:
 o added new file xtsAPI.h with renamed exported API functions all prefixed xts*
 o xts_stubs.c is now empty and replaced by the new xtsAPI.h
 o in xts.h renamed one use of keyword 'class' to 'klass' to allow includes by C++ compiler


Modified: pkg/xts/inst/include/xts.h
===================================================================
--- pkg/xts/inst/include/xts.h	2013-01-16 03:13:38 UTC (rev 757)
+++ pkg/xts/inst/include/xts.h	2013-01-17 02:27:40 UTC (rev 758)
@@ -62,7 +62,7 @@
                                                CLASS, .indexFORMAT, .indexCLASS & class */
 SEXP coredata(SEXP x);
 SEXP coredata_xts(SEXP x);
-SEXP add_class(SEXP x, SEXP class);
+SEXP add_class(SEXP x, SEXP klass);
 SEXP lagXts(SEXP x, SEXP k, SEXP pad);
 SEXP do_is_ordered(SEXP x, SEXP increasing, SEXP strictly);
 SEXP mergeXts(SEXP args);

Copied: pkg/xts/inst/include/xtsAPI.h (from rev 757, pkg/xts/inst/include/xts_stubs.c)
===================================================================
--- pkg/xts/inst/include/xtsAPI.h	                        (rev 0)
+++ pkg/xts/inst/include/xtsAPI.h	2013-01-17 02:27:40 UTC (rev 758)
@@ -0,0 +1,88 @@
+/*
+Header file for using internal C-level facilities
+provided by xts.
+
+This is not 100% designed for end users, so
+any user comments and bug reports are very
+welcomed.
+
+Copyright 2008 - 2013 Jeffrey A. Ryan   
+Copyright        2013 Dirk Eddelbuettel        
+
+This source is distributed with the same license
+as the full xts software, GPL (>= 2).
+*/
+
+#include <xts.h>		// also includes R.h, Rinternals.h, Rdefines.h
+
+#include <Rconfig.h>
+#include <R_ext/Rdynload.h>
+
+
+#ifdef HAVE_VISIBILITY_ATTRIBUTE
+  # define attribute_hidden __attribute__ ((visibility ("hidden")))
+#else
+  # define attribute_hidden
+#endif
+
+/*
+  To aid those looking for answers on interfacing compiled code from
+  another package.
+
+  This is simply constructing a function pointer for use.
+
+  static RETURNTYPE(*fun)(ARG1,ARG2) = NULL     where ARGS are the types accepted, comma seperated
+    fun = ( RETURNTYPE(*)(ARG1,ARG2)) R_GetCCallable("PACKAGENAME", "FUNCTIONNAME")
+
+*/
+int attribute_hidden xtsIs(SEXP x)
+{
+  static int(*fun)(SEXP) = NULL;
+  if(fun == NULL)
+    fun = (int(*)(SEXP)) R_GetCCallable("xts","isXts");
+  return fun(x);
+}
+
+SEXP attribute_hidden xtsIsOrdered(SEXP x, SEXP increasing, SEXP strictly)
+{
+  static SEXP(*fun)(SEXP,SEXP,SEXP) = NULL;
+  if(fun == NULL)
+    fun = (SEXP(*)(SEXP,SEXP,SEXP)) R_GetCCallable("xts","do_is_ordered");
+  return fun(x, increasing, strictly);
+}
+
+SEXP attribute_hidden xtsNaCheck(SEXP x, SEXP check)
+{
+  static SEXP(*fun)(SEXP,SEXP) = NULL;
+  if(fun == NULL)
+    fun = (SEXP(*)(SEXP,SEXP)) R_GetCCallable("xts","naCheck");
+  return fun(x, check);
+}
+
+SEXP attribute_hidden xtsTry(SEXP x) {
+    static SEXP(*fun)(SEXP) = NULL;
+    if (fun == NULL) 
+	fun = (SEXP(*)(SEXP)) R_GetCCallable("xts","tryXts");
+    return fun(x);
+}
+    
+SEXP attribute_hidden xtsRbind(SEXP x, SEXP y, SEXP dup) {
+    static SEXP(*fun)(SEXP, SEXP, SEXP) = NULL;
+    if (fun == NULL) 
+	fun = (SEXP(*)(SEXP,SEXP,SEXP)) R_GetCCallable("xts","do_rbind_xts");
+    return fun(x, y, dup);
+}
+
+SEXP attribute_hidden xtsCoredata(SEXP x) {
+    static SEXP(*fun)(SEXP) = NULL;
+    if (fun == NULL) 
+	fun = (SEXP(*)(SEXP)) R_GetCCallable("xts","coredata_xts");
+    return fun(x);
+}
+
+SEXP attribute_hidden xtsLag(SEXP x, SEXP k, SEXP pad) {
+    static SEXP(*fun)(SEXP,SEXP,SEXP) = NULL;
+    if (fun == NULL) 
+	fun = (SEXP(*)(SEXP,SEXP,SEXP)) R_GetCCallable("xts","lagXts");
+    return fun(x, k, pad);
+}

Modified: pkg/xts/inst/include/xts_stubs.c
===================================================================
--- pkg/xts/inst/include/xts_stubs.c	2013-01-16 03:13:38 UTC (rev 757)
+++ pkg/xts/inst/include/xts_stubs.c	2013-01-17 02:27:40 UTC (rev 758)
@@ -1,71 +1,3 @@
-#include <Rconfig.h>
-#include <Rinternals.h>
-#include <R_ext/Rdynload.h>
 
-#ifdef HAVE_VISIBILITY_ATTRIBUTE
-# define attribute_hidden __attribute__ ((visibility ("hidden")))
-#else
-# define attribute_hidden
-#endif
+#warning("This header is deprecated. Please include 'xtsAPI.h' instead.")
 
-/*
-  To aid those looking for answers on interfacing compiled code
-  from another package.
-
-  This is simply constructing a function pointer for use.
-
-  static RETURNTYPE(*fun)(ARG1,ARG2) = NULL     where ARGS are the types accepted, comma seperated
-    fun = ( RETURNTYPE(*)(ARG1,ARG2)) R_GetCCallable("PACKAGENAME", "FUNCTIONNAME")
-
-*/
-int attribute_hidden isXts(SEXP x)
-{
-  static int(*fun)(SEXP) = NULL;
-  if(fun == NULL)
-    fun = (int(*)(SEXP)) R_GetCCallable("xts","isXts");
-  return fun(x);
-}
-
-SEXP attribute_hidden do_is_ordered(SEXP x, SEXP increasing, SEXP strictly)
-{
-  static SEXP(*fun)(SEXP,SEXP,SEXP) = NULL;
-  if(fun == NULL)
-    fun = (SEXP(*)(SEXP,SEXP,SEXP)) R_GetCCallable("xts","do_is_ordered");
-  return fun(x, increasing, strictly);
-}
-
-SEXP attribute_hidden naCheck(SEXP x, SEXP check)
-{
-  static SEXP(*fun)(SEXP,SEXP) = NULL;
-  if(fun == NULL)
-    fun = (SEXP(*)(SEXP,SEXP)) R_GetCCallable("xts","naCheck");
-  return fun(x, check);
-}
-
-SEXP attribute_hidden tryXts(SEXP x) {
-    static SEXP(*fun)(SEXP) = NULL;
-    if (fun == NULL) 
-	fun = (SEXP(*)(SEXP)) R_GetCCallable("xts","tryXts");
-    return fun(x);
-}
-    
-SEXP attribute_hidden do_rbind_xts(SEXP x, SEXP y, SEXP dup) {
-    static SEXP(*fun)(SEXP, SEXP, SEXP) = NULL;
-    if (fun == NULL) 
-	fun = (SEXP(*)(SEXP,SEXP,SEXP)) R_GetCCallable("xts","do_rbind_xts");
-    return fun(x, y, dup);
-}
-
-SEXP attribute_hidden coredata_xts(SEXP x) {
-    static SEXP(*fun)(SEXP) = NULL;
-    if (fun == NULL) 
-	fun = (SEXP(*)(SEXP)) R_GetCCallable("xts","coredata_xts");
-    return fun(x);
-}
-
-SEXP attribute_hidden lagXts(SEXP x, SEXP k, SEXP pad) {
-    static SEXP(*fun)(SEXP,SEXP,SEXP) = NULL;
-    if (fun == NULL) 
-	fun = (SEXP(*)(SEXP,SEXP,SEXP)) R_GetCCallable("xts","lagXts");
-    return fun(x, k, pad);
-}



More information about the Xts-commits mailing list