The R Project SVN R

Rev

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

Rev 7886 Rev 9147
Line 344... Line 344...
344
SEXP do_symbol(SEXP call, SEXP op, SEXP args, SEXP env)
344
SEXP do_symbol(SEXP call, SEXP op, SEXP args, SEXP env)
345
{
345
{
346
    char buf[128], *p, *q;
346
    char buf[128], *p, *q;
347
    checkArity(op, args);
347
    checkArity(op, args);
348
    if(!isValidString(CAR(args)))
348
    if(!isValidString(CAR(args)))
349
	errorcall(call, "invalid argument");
349
	errorcall(call, R_MSG_IA);
350
    p = CHAR(STRING(CAR(args))[0]);
350
    p = CHAR(STRING(CAR(args))[0]);
351
    q = buf;
351
    q = buf;
352
    while ((*q = *p) != '\0') {
352
    while ((*q = *p) != '\0') {
353
	p++;
353
	p++;
354
	q++;
354
	q++;
Line 368... Line 368...
368
    DL_FUNC fun;
368
    DL_FUNC fun;
369
    char *sym;
369
    char *sym;
370
    int val;
370
    int val;
371
    checkArity(op, args);
371
    checkArity(op, args);
372
    if(!isValidString(CAR(args)))
372
    if(!isValidString(CAR(args)))
373
	errorcall(call, "invalid argument");
373
	errorcall(call, R_MSG_IA);
374
    sym = CHAR(STRING(CAR(args))[0]);
374
    sym = CHAR(STRING(CAR(args))[0]);
375
    val = 1;
375
    val = 1;
376
    if (!(fun = R_FindSymbol(sym, "")))
376
    if (!(fun = R_FindSymbol(sym, "")))
377
	val = 0;
377
	val = 0;
378
    ans = allocVector(LGLSXP, 1);
378
    ans = allocVector(LGLSXP, 1);