| Line 1... |
Line 1... |
| 1 |
#include "R.h"
|
1 |
#include "R.h"
|
| 2 |
#include "Rdefines.h"
|
2 |
#include "Rdefines.h"
|
| 3 |
#include "Rinternals.h"
|
3 |
#include "Rinternals.h"
|
| 4 |
#include "sqlite3.h"
|
4 |
#include "sqlite3.h"
|
| - |
|
5 |
#include "exports.h"
|
| 5 |
|
6 |
|
| 6 |
#ifndef __SQLITE_DATAFRAME__
|
7 |
#ifndef __SQLITE_DATAFRAME__
|
| 7 |
#define __SQLITE_DATAFRAME__
|
8 |
#define __SQLITE_DATAFRAME__
|
| 8 |
|
9 |
|
| 9 |
/* # of sql buffers */
|
10 |
/* # of sql buffers */
|
| Line 48... |
Line 49... |
| 48 |
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 */
|
| 49 |
int UNUSE_SDF2(const char *iname); /* somewhat like UNPROTECT */
|
50 |
int UNUSE_SDF2(const char *iname); /* somewhat like UNPROTECT */
|
| 50 |
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 */
|
| 51 |
int _add_sdf1(char *filename, char *internal_name); /* add SDF to workspace */
|
52 |
int _add_sdf1(char *filename, char *internal_name); /* add SDF to workspace */
|
| 52 |
void _delete_sdf2(const char *iname); /* remove SDF from workspace */
|
53 |
void _delete_sdf2(const char *iname); /* remove SDF from workspace */
|
| 53 |
int _get_factor_levels1(const char *iname, const char *varname, SEXP var);
|
54 |
int _get_factor_levels1(const char *iname, const char *varname, SEXP var, int set_class);
|
| 54 |
int _get_row_count2(const char *table, int quote);
|
55 |
int _get_row_count2(const char *table, int quote);
|
| 55 |
SEXP _get_rownames(const char *sdf_iname);
|
56 |
SEXP _get_rownames(const char *sdf_iname);
|
| 56 |
char *_get_full_pathname2(char *relpath); /* get full path given relpath, used in workspace mgmt */
|
57 |
char *_get_full_pathname2(char *relpath); /* get full path given relpath, used in workspace mgmt */
|
| 57 |
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);
|
| 58 |
SEXP _get_rownames2(const char *sdf_iname);
|
59 |
SEXP _get_rownames2(const char *sdf_iname);
|
| 59 |
|
60 |
|
| 60 |
/* utilities for creating SDF's */
|
61 |
/* utilities for creating SDFs */
|
| 61 |
char *_create_sdf_skeleton1(SEXP name, int *o_namelen, int protect);
|
62 |
char *_create_sdf_skeleton1(SEXP name, int *o_namelen, int protect);
|
| 62 |
int _copy_factor_levels2(const char *factor_type, const char *iname_src,
|
63 |
int _copy_factor_levels2(const char *factor_type, const char *iname_src,
|
| 63 |
const char *colname_src, const char *iname_dst, const char *colname_dst);
|
64 |
const char *colname_src, const char *iname_dst, const char *colname_dst);
|
| 64 |
int _create_factor_table2(const char *iname, const char *factor_type,
|
65 |
int _create_factor_table2(const char *iname, const char *factor_type,
|
| 65 |
const char *colname);
|
66 |
const char *colname);
|
| 66 |
char *_create_svector1(SEXP name, const char *type, int * _namelen, int protect);
|
67 |
char *_create_svector1(SEXP name, const char *type, int * _namelen, int protect);
|
| 67 |
|
68 |
|
| - |
|
69 |
/* utilities for creating SVecs */
|
| - |
|
70 |
int _get_vector_index_typed_result(sqlite3_stmt *stmt, SEXP *ret, int colidx,
|
| - |
|
71 |
int idx_or_len, int *coltype);
|
| - |
|
72 |
|
| 68 |
/* R utilities */
|
73 |
/* R utilities */
|
| 69 |
SEXP _getListElement(SEXP list, char *varname);
|
74 |
SEXP _getListElement(SEXP list, char *varname);
|
| 70 |
SEXP _shrink_vector(SEXP vec, int len); /* shrink vector size */
|
75 |
SEXP _shrink_vector(SEXP vec, int len); /* shrink vector size */
|
| 71 |
|
76 |
|
| 72 |
/* sqlite utilities */
|
77 |
/* sqlite utilities */
|
| Line 124... |
Line 129... |
| 124 |
|
129 |
|
| 125 |
/* R SXP type constants */
|
130 |
/* R SXP type constants */
|
| 126 |
#define FACTORSXP 11
|
131 |
#define FACTORSXP 11
|
| 127 |
#define ORDEREDSXP 12
|
132 |
#define ORDEREDSXP 12
|
| 128 |
|
133 |
|
| 129 |
|
- |
|
| 130 |
|
- |
|
| 131 |
/* top level functions */
|
134 |
/* additional column types */
|
| 132 |
/* sqlite_workspace.c */
|
- |
|
| 133 |
SEXP sdf_init_workspace();
|
- |
|
| 134 |
SEXP sdf_finalize_workspace();
|
- |
|
| 135 |
SEXP sdf_list_sdfs(SEXP pattern);
|
- |
|
| 136 |
SEXP sdf_get_sdf(SEXP name);
|
- |
|
| 137 |
SEXP sdf_attach_sdf(SEXP filename, SEXP internal_name);
|
- |
|
| 138 |
SEXP sdf_detach_sdf(SEXP internal_name);
|
- |
|
| 139 |
SEXP sdf_rename_sdf(SEXP sdf, SEXP name);
|
- |
|
| 140 |
|
- |
|
| 141 |
/* sqlite_dataframe.c */
|
135 |
#define SQLITEDF_BIT 100
|
| 142 |
SEXP sdf_create_sdf(SEXP df, SEXP name);
|
- |
|
| 143 |
SEXP sdf_get_names(SEXP sdf);
|
- |
|
| 144 |
SEXP sdf_get_length(SEXP sdf);
|
- |
|
| 145 |
SEXP sdf_get_row_count(SEXP sdf);
|
- |
|
| 146 |
SEXP sdf_import_table(SEXP _filename, SEXP _name, SEXP _sep, SEXP _quote,
|
- |
|
| 147 |
SEXP _rownames, SEXP _colnames);
|
- |
|
| 148 |
SEXP sdf_get_index(SEXP sdf, SEXP row, SEXP col, SEXP new_sdf);
|
- |
|
| 149 |
SEXP sdf_rbind(SEXP sdf, SEXP data);
|
- |
|
| 150 |
SEXP sdf_get_iname(SEXP sdf);
|
- |
|
| 151 |
|
- |
|
| 152 |
/* sqlite_vector.c */
|
- |
|
| 153 |
SEXP sdf_get_variable(SEXP sdf, SEXP name);
|
- |
|
| 154 |
SEXP sdf_get_variable_length(SEXP svec);
|
- |
|
| 155 |
SEXP sdf_get_variable_index(SEXP svec, SEXP idx);
|
- |
|
| 156 |
/* SEXP sdf_set_variable_index(SEXP svec, SEXP idx, SEXP value); */
|
- |
|
| 157 |
SEXP sdf_variable_summary(SEXP svec, SEXP maxsum);
|
- |
|
| 158 |
SEXP sdf_do_variable_math(SEXP func, SEXP vector, SEXP other_args);
|
- |
|
| 159 |
SEXP sdf_do_variable_op(SEXP func, SEXP vector, SEXP op2, SEXP arg_reversed);
|
- |
|
| 160 |
SEXP sdf_do_variable_summary(SEXP func, SEXP vector, SEXP na_rm);
|
- |
|
| 161 |
SEXP sdf_sort_variable(SEXP svec, SEXP decreasing);
|
- |
|
| 162 |
|
- |
|
| 163 |
/* sqlite_external.c */
|
- |
|
| 164 |
SEXP sdf_import_sqlite_table(SEXP _dbfilename, SEXP _tblname, SEXP _sdfiname);
|
- |
|
| 165 |
|
- |
|
| 166 |
/* sqlite_matrix.c */
|
- |
|
| 167 |
SEXP sdf_as_matrix(SEXP sdf, SEXP name);
|
- |
|
| 168 |
SEXP sdf_create_smat(SEXP svec, SEXP dimnames);
|
- |
|
| 169 |
|
- |
|
| 170 |
/* sqlite_biglm.c */
|
- |
|
| 171 |
SEXP sdf_do_biglm(SEXP sdfx, SEXP svecy, SEXP sdfx_dim, SEXP intercept);
|
- |
|
| 172 |
|
136 |
|
| 173 |
#endif
|
137 |
#endif
|