The R Project SVN R

Rev

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

Rev 14577 Rev 14585
Line 314... Line 314...
314
	} else if(TAG(s) == DupSymbol) {
314
	} else if(TAG(s) == DupSymbol) {
315
	    *dup = asLogical(CAR(s));
315
	    *dup = asLogical(CAR(s));
316
	    /* SETCDR(prev, s = CDR(s)); */
316
	    /* SETCDR(prev, s = CDR(s)); */
317
	    if(dupused++ == 1) warning("DUP used more than once");
317
	    if(dupused++ == 1) warning("DUP used more than once");
318
	} else if(TAG(s) == PkgSymbol) {
318
	} else if(TAG(s) == PkgSymbol) {
319
	    if(pkgused++ == 1) warning("PACKAGE used more than once");
-
 
320
	    strcpy(DLLname, CHAR(STRING_ELT(CAR(s), 0)));
319
	    strcpy(DLLname, CHAR(STRING_ELT(CAR(s), 0)));
-
 
320
	    if(pkgused++ > 1) warning("PACKAGE used more than once");
-
 
321
	    /* More generally, this should allow us to process
-
 
322
               any additional arguments and not insist that PACKAGE
-
 
323
               be the last argument.
-
 
324
             */
321
            if(s == args)
325
             if(s == args) 
322
		args = CDR(s);
326
		 args = s = CDR(s);
323
            else
327
             else 
324
	        SETCDR(prev, s = CDR(s)); /* delete this arg, which is the next one */
328
		 SETCDR(prev, s = CDR(s));
325
            continue;
329
             continue;
326
	} else {
-
 
327
	}
330
	} 
328
        nargs++;
331
        nargs++;
329
	prev = s;
332
	prev = s;
330
	s = CDR(s);
333
	s = CDR(s);
331
    }
334
    }
332
    *len = nargs;
335
    *len = nargs;
Line 1227... Line 1230...
1227
 
1230
 
1228
    /* Convert the arguments for use in foreign */
1231
    /* Convert the arguments for use in foreign */
1229
    /* function calls.  Note that we copy twice */
1232
    /* function calls.  Note that we copy twice */
1230
    /* once here, on the way into the call, and */
1233
    /* once here, on the way into the call, and */
1231
    /* once below on the way out. */
1234
    /* once below on the way out. */
1232
 
-
 
1233
    cargs = (void**)R_alloc(nargs, sizeof(void*));
1235
    cargs = (void**)R_alloc(nargs, sizeof(void*));
1234
    nargs = 0;
1236
    nargs = 0;
1235
    for(pargs = args ; pargs != R_NilValue; pargs = CDR(pargs)) {
1237
    for(pargs = args ; pargs != R_NilValue; pargs = CDR(pargs)) {
1236
	cargs[nargs] = RObjToCPtr(CAR(pargs), naok, dup, nargs + 1, which, buf, argConverters + nargs);
1238
	cargs[nargs] = RObjToCPtr(CAR(pargs), naok, dup, nargs + 1, which, buf, argConverters + nargs);
1237
	nargs++;
1239
	nargs++;