The R Project SVN R

Rev

Rev 60746 | Rev 60844 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 60746 Rev 60765
Line 173... Line 173...
173
  address directly, and if the DLL is specified. If no PACKAGE is
173
  address directly, and if the DLL is specified. If no PACKAGE is
174
  provided, we check whether the calling function is in a namespace
174
  provided, we check whether the calling function is in a namespace
175
  and look there.
175
  and look there.
176
*/
176
*/
177
 
177
 
178
#define CHECK_NAMESPACE_RESOLUTION 2
-
 
179
 
-
 
180
static SEXP
178
static SEXP
181
resolveNativeRoutine(SEXP args, DL_FUNC *fun,
179
resolveNativeRoutine(SEXP args, DL_FUNC *fun,
182
		     R_RegisteredNativeSymbol *symbol, char *buf,
180
		     R_RegisteredNativeSymbol *symbol, char *buf,
183
		     int *nargs, int *naok, int *dup, SEXP call, SEXP env)
181
		     int *nargs, int *naok, int *dup, SEXP call, SEXP env)
184
{
182
{
Line 251... Line 249...
251
    if(dll.type != FILENAME && strlen(ns)) {
249
    if(dll.type != FILENAME && strlen(ns)) {
252
	/* no PACKAGE= arg, so see if we can identify a DLL
250
	/* no PACKAGE= arg, so see if we can identify a DLL
253
	   from the namespace defining the function */
251
	   from the namespace defining the function */
254
	*fun = R_FindNativeSymbolFromDLL(buf, &dll, symbol, env2);
252
	*fun = R_FindNativeSymbolFromDLL(buf, &dll, symbol, env2);
255
	if (*fun) return args;
253
	if (*fun) return args;
256
#ifdef CHECK_NAMESPACE_RESOLUTION
-
 
257
#if CHECK_NAMESPACE_RESOLUTION > 1
-
 
258
	errorcall(call, 
-
 
259
#else
-
 
260
	warningcall(call, 
-
 
261
#endif
-
 
262
		    "\"%s\" not resolved from current namespace (%s)", buf, ns);
254
	errorcall(call, "\"%s\" not resolved from current namespace (%s)", 
263
#endif
255
		  buf, ns);
264
	/* need to continue if the namespace search failed */
-
 
265
    }
256
    }
266
 
257
 
267
    /* NB: the actual conversion to the symbol is done in
258
    /* NB: the actual conversion to the symbol is done in
268
       R_dlsym in Rdynload.c.  That prepends an underscore (usually),
259
       R_dlsym in Rdynload.c.  That prepends an underscore (usually),
269
       and may append one or more underscores.
260
       and may append one or more underscores.