| Line 39... |
Line 39... |
| 39 |
|
39 |
|
| 40 |
#define WORKSPACE_COLUMNS 6
|
40 |
#define WORKSPACE_COLUMNS 6
|
| 41 |
#define MAX_ATTACHED 30 /* 31 including workspace.db */
|
41 |
#define MAX_ATTACHED 30 /* 31 including workspace.db */
|
| 42 |
|
42 |
|
| 43 |
/* utilities for checking characteristics of arg */
|
43 |
/* utilities for checking characteristics of arg */
|
| 44 |
int _is_r_sym(char *sym);
|
44 |
int _is_r_sym(const char *sym);
|
| 45 |
int _file_exists(char *filename);
|
45 |
int _file_exists(char *filename);
|
| 46 |
int _sdf_exists2(char *iname);
|
46 |
int _sdf_exists2(const char *iname);
|
| 47 |
|
47 |
|
| 48 |
/* sdf utilities */
|
48 |
/* sdf utilities */
|
| 49 |
int USE_SDF1(const char *iname, int exists, int protect); /* call this before doing anything on an SDF */
|
49 |
int USE_SDF1(const char *iname, int exists, int protect); /* call this before doing anything on an SDF */
|
| 50 |
int UNUSE_SDF2(const char *iname); /* somewhat like UNPROTECT */
|
50 |
int UNUSE_SDF2(const char *iname); /* somewhat like UNPROTECT */
|
| 51 |
SEXP _create_sdf_sexp(const char *iname); /* create a SEXP for an SDF */
|
51 |
SEXP _create_sdf_sexp(const char *iname); /* create a SEXP for an SDF */
|
| 52 |
int _add_sdf1(char *filename, char *internal_name); /* add SDF to workspace */
|
52 |
int _add_sdf1(const char *filename, const char *internal_name); /* add SDF to workspace */
|
| 53 |
void _delete_sdf2(const char *iname); /* remove SDF from workspace */
|
53 |
void _delete_sdf2(const char *iname); /* remove SDF from workspace */
|
| 54 |
int _get_factor_levels1(const char *iname, const char *varname, SEXP var, int set_class);
|
54 |
int _get_factor_levels1(const char *iname, const char *varname, SEXP var, int set_class);
|
| 55 |
int _get_row_count2(const char *table, int quote);
|
55 |
int _get_row_count2(const char *table, int quote);
|
| 56 |
SEXP _get_rownames(const char *sdf_iname);
|
56 |
SEXP _get_rownames(const char *sdf_iname);
|
| 57 |
char *_get_full_pathname2(char *relpath); /* get full path given relpath, used in workspace mgmt */
|
57 |
char *_get_full_pathname2(const char *relpath); /* get full path given relpath, used in workspace mgmt */
|
| 58 |
int _is_factor2(const char *iname, const char *factor_type, const char *colname);
|
58 |
int _is_factor2(const char *iname, const char *factor_type, const char *colname);
|
| 59 |
SEXP _get_rownames2(const char *sdf_iname);
|
59 |
SEXP _get_rownames2(const char *sdf_iname);
|
| 60 |
|
60 |
|
| 61 |
/* utilities for creating SDFs */
|
61 |
/* utilities for creating SDFs */
|
| 62 |
char *_create_sdf_skeleton1(SEXP name, int *o_namelen, int protect);
|
62 |
char *_create_sdf_skeleton1(SEXP name, int *o_namelen, int protect);
|
| Line 69... |
Line 69... |
| 69 |
/* utilities for creating SVecs */
|
69 |
/* utilities for creating SVecs */
|
| 70 |
int _get_vector_index_typed_result(sqlite3_stmt *stmt, SEXP *ret, int colidx,
|
70 |
int _get_vector_index_typed_result(sqlite3_stmt *stmt, SEXP *ret, int colidx,
|
| 71 |
int idx_or_len, int *coltype);
|
71 |
int idx_or_len, int *coltype);
|
| 72 |
|
72 |
|
| 73 |
/* R utilities */
|
73 |
/* R utilities */
|
| 74 |
SEXP _getListElement(SEXP list, char *varname);
|
74 |
SEXP _getListElement(SEXP list, const char *varname);
|
| 75 |
SEXP _shrink_vector(SEXP vec, int len); /* shrink vector size */
|
75 |
SEXP _shrink_vector(SEXP vec, int len); /* shrink vector size */
|
| 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 |
int _get_r_type(const char *decl_type); /* get r type based on sqlite decltype */
|
| 82 |
sqlite3* _is_sqlitedb(char *filename);
|
82 |
sqlite3* _is_sqlitedb(const char *filename);
|
| 83 |
void _init_sqlite_function_accumulator();
|
83 |
void _init_sqlite_function_accumulator();
|
| 84 |
int *_make_row_index(SEXP idx, int *plen);
|
84 |
int *_make_row_index(SEXP idx, int *plen);
|
| 85 |
|
85 |
|
| 86 |
/* global buffer (g_sql_buf) utilities */
|
86 |
/* global buffer (g_sql_buf) utilities */
|
| 87 |
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 */
|