| Line 76... |
Line 76... |
| 76 |
|
76 |
|
| 77 |
/* sqlite utilities */
|
77 |
/* sqlite utilities */
|
| 78 |
int _empty_callback(void *data, int ncols, char **row, char **cols);
|
78 |
int _empty_callback(void *data, int ncols, char **row, char **cols);
|
| 79 |
int _sqlite_error_check(int res, const char *file, int line);
|
79 |
int _sqlite_error_check(int res, const char *file, int line);
|
| 80 |
const char *_get_column_type(const char *class, int type); /* get sqlite type corresponding to R class & type */
|
80 |
const char *_get_column_type(const char *class, int type); /* get sqlite type corresponding to R class & type */
|
| - |
|
81 |
int _get_r_type(const char *decl_type); /* get r type based on sqlite decltype */
|
| 81 |
sqlite3* _is_sqlitedb(char *filename);
|
82 |
sqlite3* _is_sqlitedb(char *filename);
|
| 82 |
void _init_sqlite_function_accumulator();
|
83 |
void _init_sqlite_function_accumulator();
|
| - |
|
84 |
int *_make_row_index(SEXP idx, int *plen);
|
| 83 |
|
85 |
|
| 84 |
/* global buffer (g_sql_buf) utilities */
|
86 |
/* global buffer (g_sql_buf) utilities */
|
| 85 |
R_INLINE void _expand_buf(int i, int size); /* expand ith buf if size > buf[i].size */
|
87 |
R_INLINE void _expand_buf(int i, int size); /* expand ith buf if size > buf[i].size */
|
| 86 |
|
88 |
|
| 87 |
|
89 |
|
| Line 97... |
Line 99... |
| 97 |
char *_str_tolower(char *out, const char *ref);
|
99 |
char *_str_tolower(char *out, const char *ref);
|
| 98 |
|
100 |
|
| 99 |
/* register functions to sqlite */
|
101 |
/* register functions to sqlite */
|
| 100 |
void __register_vector_math();
|
102 |
void __register_vector_math();
|
| 101 |
|
103 |
|
| 102 |
#define _sqlite_exec(sql) sqlite3_exec(g_workspace, sql, _empty_callback, NULL, NULL)
|
104 |
#define _sqlite_exec(sql) sqlite3_exec(g_workspace, sql, NULL, NULL, NULL)
|
| 103 |
#define _sqlite_error(res) _sqlite_error_check((res), __FILE__, __LINE__)
|
105 |
#define _sqlite_error(res) _sqlite_error_check((res), __FILE__, __LINE__)
|
| 104 |
|
106 |
|
| 105 |
#ifdef __SQLITE_DEBUG__
|
107 |
#ifdef __SQLITE_DEBUG__
|
| 106 |
#define _sqlite_begin { _sqlite_error(_sqlite_exec("begin")); Rprintf("begin at " __FILE__ " line %d\n", __LINE__); }
|
108 |
#define _sqlite_begin { _sqlite_error(_sqlite_exec("begin")); Rprintf("begin at " __FILE__ " line %d\n", __LINE__); }
|
| 107 |
#define _sqlite_commit { _sqlite_error(_sqlite_exec("commit")); Rprintf("commit at " __FILE__ " line %d\n", __LINE__); }
|
109 |
#define _sqlite_commit { _sqlite_error(_sqlite_exec("commit")); Rprintf("commit at " __FILE__ " line %d\n", __LINE__); }
|