The R Project SVN R-packages

Rev

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

Rev 3255 Rev 3281
Line 99... Line 99...
99
}
99
}
100
 
100
 
101
SEXP sdf_init_workspace() {
101
SEXP sdf_init_workspace() {
102
    int file_idx = 0, i;
102
    int file_idx = 0, i;
103
    char *basename = "workspace", *filename;
103
    char *basename = "workspace", *filename;
104
    FILE *f;
-
 
105
    SEXP ret;
104
    SEXP ret;
106
 
105
 
107
    /* initialize sql_buf */
106
    /* initialize sql_buf */
108
    for (i = 0; i < NBUFS; i++) {
107
    for (i = 0; i < NBUFS; i++) {
109
        if (g_sql_buf[i] == NULL) {
108
        if (g_sql_buf[i] == NULL) {
Line 199... Line 198...
199
                &result, &nrow, &ncol, NULL);
198
                &result, &nrow, &ncol, NULL);
200
    } else {
199
    } else {
201
        /* since internal_names must be a valid r symbol, 
200
        /* since internal_names must be a valid r symbol, 
202
           did not check for "'" */
201
           did not check for "'" */
203
        sprintf(g_sql_buf[0], "select internal_name from workspace where "
202
        sprintf(g_sql_buf[0], "select internal_name from workspace where "
204
                "internal_name like '%s\%'", CHAR(STRING_ELT(pattern, 0)));
203
                "internal_name like '%s%'", CHAR(STRING_ELT(pattern, 0)));
205
        res = sqlite3_get_table(g_workspace, g_sql_buf[0], &result, &nrow,
204
        res = sqlite3_get_table(g_workspace, g_sql_buf[0], &result, &nrow,
206
                &ncol, NULL);
205
                &ncol, NULL);
207
    }
206
    }
208
 
207
 
209
    if (_sqlite_error(res)) return R_NilValue;
208
    if (_sqlite_error(res)) return R_NilValue;