The R Project SVN R

Rev

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

Rev 12778 Rev 12976
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Langage for Statistical Data Analysis
2
 *  R : A Computer Langage for Statistical Data Analysis
3
 *  Copyright (C) 1995  Robert Gentleman and Ross Ihaka
3
 *  Copyright (C) 1995  Robert Gentleman and Ross Ihaka
4
 *  Copyright (C) 1997-2000  The R Development Core Team
4
 *  Copyright (C) 1997-2001  The R Development Core Team
5
 *
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
9
 *  (at your option) any later version.
Line 364... Line 364...
364
}
364
}
365
 
365
 
366
SEXP do_isloaded(SEXP call, SEXP op, SEXP args, SEXP env)
366
SEXP do_isloaded(SEXP call, SEXP op, SEXP args, SEXP env)
367
{
367
{
368
    SEXP ans;
368
    SEXP ans;
369
    DL_FUNC fun;
-
 
370
    char *sym;
369
    char *sym;
371
    int val;
370
    int val;
372
    checkArity(op, args);
371
    checkArity(op, args);
373
    if(!isValidString(CAR(args)))
372
    if(!isValidString(CAR(args)))
374
	errorcall(call, R_MSG_IA);
373
	errorcall(call, R_MSG_IA);
375
    sym = CHAR(STRING_ELT(CAR(args), 0));
374
    sym = CHAR(STRING_ELT(CAR(args), 0));
376
    val = 1;
375
    val = 1;
377
    if (!(fun = R_FindSymbol(sym, "")))
376
    if (!(R_FindSymbol(sym, "")))
378
	val = 0;
377
	val = 0;
379
    ans = allocVector(LGLSXP, 1);
378
    ans = allocVector(LGLSXP, 1);
380
    LOGICAL(ans)[0] = val;
379
    LOGICAL(ans)[0] = val;
381
    return ans;
380
    return ans;
382
}
381
}