The R Project SVN R-packages

Rev

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

Rev 3282 Rev 3284
Line 76... Line 76...
76
        }
76
        }
77
        
77
        
78
        if (strcmp(coltype, "text") == 0) {
78
        if (strcmp(coltype, "text") == 0) {
79
            PROTECT(*ret = NEW_CHARACTER(idx_or_len));
79
            PROTECT(*ret = NEW_CHARACTER(idx_or_len));
80
            if (added) 
80
            if (added) 
81
                SET_STRING_ELT(*ret, 0, mkChar(sqlite3_column_text(stmt, 0)));
81
                SET_STRING_ELT(*ret, 0, mkChar((char *)sqlite3_column_text(stmt, 0)));
82
        } else if (strcmp(coltype, "double") == 0) {
82
        } else if (strcmp(coltype, "double") == 0) {
83
            PROTECT(*ret = NEW_NUMERIC(idx_or_len));
83
            PROTECT(*ret = NEW_NUMERIC(idx_or_len));
84
            if (added) REAL(*ret)[0] = sqlite3_column_double(stmt, 0);
84
            if (added) REAL(*ret)[0] = sqlite3_column_double(stmt, 0);
85
        } else if (strcmp(coltype, "bit") == 0) {
85
        } else if (strcmp(coltype, "bit") == 0) {
86
            PROTECT(*ret = NEW_LOGICAL(idx_or_len));
86
            PROTECT(*ret = NEW_LOGICAL(idx_or_len));
Line 97... Line 97...
97
        const char *coltype = sqlite3_column_decltype(stmt, 0);
97
        const char *coltype = sqlite3_column_decltype(stmt, 0);
98
        if (sqlite3_column_type(stmt, 0) == SQLITE_NULL) {
98
        if (sqlite3_column_type(stmt, 0) == SQLITE_NULL) {
99
            added = 0;
99
            added = 0;
100
        } else if (strcmp(coltype, "text") == 0) {
100
        } else if (strcmp(coltype, "text") == 0) {
101
            SET_STRING_ELT(*ret, idx_or_len, 
101
            SET_STRING_ELT(*ret, idx_or_len, 
102
                    mkChar(sqlite3_column_text(stmt, 0)));
102
                    mkChar((char *)sqlite3_column_text(stmt, 0)));
103
        } else if (strcmp(coltype, "double") == 0) {
103
        } else if (strcmp(coltype, "double") == 0) {
104
            REAL(*ret)[idx_or_len] = sqlite3_column_double(stmt, 0);
104
            REAL(*ret)[idx_or_len] = sqlite3_column_double(stmt, 0);
105
        } else if (strcmp(coltype, "bit") == 0) {
105
        } else if (strcmp(coltype, "bit") == 0) {
106
            INTEGER(*ret)[idx_or_len] = sqlite3_column_int(stmt, 0);
106
            INTEGER(*ret)[idx_or_len] = sqlite3_column_int(stmt, 0);
107
        } else if (strcmp(coltype, "integer") == 0 ||
107
        } else if (strcmp(coltype, "integer") == 0 ||