The R Project SVN R

Rev

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

Rev 28176 Rev 28196
Line 2041... Line 2041...
2041
    }
2041
    }
2042
}
2042
}
2043
 
2043
 
2044
SEXP do_ls(SEXP call, SEXP op, SEXP args, SEXP rho)
2044
SEXP do_ls(SEXP call, SEXP op, SEXP args, SEXP rho)
2045
{
2045
{
2046
    SEXP ans, env, envp;
2046
    SEXP env, envp;
2047
    int all, i, k, n;
2047
    int all;
2048
    checkArity(op, args);
2048
    checkArity(op, args);
2049
 
2049
 
2050
    if(IS_USER_DATABASE(CAR(args))) {
2050
    if(IS_USER_DATABASE(CAR(args))) {
2051
	R_ObjectTable *tb = (R_ObjectTable*) R_ExternalPtrAddr(HASHTAB(CAR(args)));      
2051
	R_ObjectTable *tb = (R_ObjectTable*) R_ExternalPtrAddr(HASHTAB(CAR(args)));      
2052
        return(tb->objects(tb));
2052
        return(tb->objects(tb));
Line 2066... Line 2066...
2066
 
2066
 
2067
    all = asLogical(CADR(args));
2067
    all = asLogical(CADR(args));
2068
    if (all == NA_LOGICAL)
2068
    if (all == NA_LOGICAL)
2069
      all = 0;
2069
      all = 0;
2070
 
2070
 
2071
    R_lsInternal(env, all);
2071
    return R_lsInternal(env, all);
2072
 
-
 
2073
}
2072
}
2074
 
2073
 
2075
/* takes a *list* of environments and a boolean indicating whether to get all
2074
/* takes a *list* of environments and a boolean indicating whether to get all
2076
   names */
2075
   names */
2077
SEXP R_lsInternal(SEXP env, Rboolean all)
2076
SEXP R_lsInternal(SEXP env, Rboolean all)
2078
{
2077
{
2079
  int  i, k, n;
2078
  int  i, k, n;
2080
  SEXP ans, envp;
2079
  SEXP ans;
2081
 
2080
 
2082
 
2081
 
2083
    /* Step 1 : Compute the Vector Size */
2082
    /* Step 1 : Compute the Vector Size */
2084
    k = 0;
2083
    k = 0;
2085
    n = length(env);
2084
    n = length(env);