[rkward-cvs] rkward/rkward/rbackend rembedinternal.cpp,1.35,1.36 rembedinternal.h,1.18,1.19 rthread.cpp,1.32,1.33

Thomas Friedrichsmeier tfry at users.sourceforge.net
Tue Apr 11 15:43:21 UTC 2006


Update of /cvsroot/rkward/rkward/rkward/rbackend
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10704

Modified Files:
	rembedinternal.cpp rembedinternal.h rthread.cpp 
Log Message:
Work around missing addDLL call in R 2.3.0

Index: rembedinternal.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rbackend/rembedinternal.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** rembedinternal.h	13 Nov 2005 14:31:29 -0000	1.18
--- rembedinternal.h	11 Apr 2006 15:43:19 -0000	1.19
***************
*** 136,139 ****
--- 136,140 ----
  	virtual void handleStandardCallback (RCallbackArgs *args) = 0;
  
+ 	bool registerFunctions (char *library_path);
  /** only one instance of this class may be around. This pointer keeps the reference to it, for interfacing to from C to C++ */
  	static REmbedInternal *this_pointer;

Index: rthread.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rbackend/rthread.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** rthread.cpp	6 Apr 2006 12:14:05 -0000	1.32
--- rthread.cpp	11 Apr 2006 15:43:19 -0000	1.33
***************
*** 375,380 ****
--- 375,393 ----
  	int status = 0;
  	
+ 	char **paths;
  	runCommandInternal ("library (\"rkward\")\n", &error);
  	if (error) status |= LibLoadFail;
+ 	int c;
+ 	paths = getCommandAsStringVector ("library.dynam (\"rkward\", \"rkward\")$path\n", &c, &error);
+ 	if ((error) || (c != 1)) {
+ 		status |= LibLoadFail;
+ 	} else {
+ 		if (!registerFunctions (paths[0])) status |= LibLoadFail;
+ 	}
+ 	for (int i = (c-1); i >=0; --i) {
+ 		DELETE_STRING (paths[i]);
+ 	}
+ 	delete [] paths;
+ 
  	QStringList commands = RKSettingsModuleR::makeRRunTimeOptionCommands ();
  	for (QStringList::const_iterator it = commands.begin (); it != commands.end (); ++it) {

Index: rembedinternal.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rbackend/rembedinternal.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** rembedinternal.cpp	6 Apr 2006 13:37:42 -0000	1.35
--- rembedinternal.cpp	11 Apr 2006 15:43:19 -0000	1.36
***************
*** 33,36 ****
--- 33,37 ----
  #include "R_ext/Parse.h"
  
+ #include <dlfcn.h>
  #include <stdlib.h>
  #include <string.h>
***************
*** 348,355 ****
  	}
  
! // let's hope R internals never change...
! 	addDLL (strdup ("rkward_pseudo_dll_pseudo_path"), strdup ("rkward_pseudo_dll"), 0);
! 	DllInfo *info = R_getDllInfo ("rkward_pseudo_dll_pseudo_path");
! 	
  	R_CallMethodDef callMethods [] = {
  //		{ "rk.do.condition", (DL_FUNC) &doCondition, 1 },
--- 349,359 ----
  	}
  
! 	return true;
! }
! 
! bool REmbedInternal::registerFunctions (char *library_path) {
! 	DllInfo *info = R_getDllInfo (library_path);
! 	if (!info) return false;
! 
  	R_CallMethodDef callMethods [] = {
  //		{ "rk.do.condition", (DL_FUNC) &doCondition, 1 },





More information about the rkward-tracker mailing list