| Line 5... |
Line 5... |
| 5 |
|
5 |
|
| 6 |
#ifndef __SQLITE_DATAFRAME__
|
6 |
#ifndef __SQLITE_DATAFRAME__
|
| 7 |
#define __SQLITE_DATAFRAME__
|
7 |
#define __SQLITE_DATAFRAME__
|
| 8 |
|
8 |
|
| 9 |
#define WORKSPACE_COLUMNS 5
|
9 |
#define WORKSPACE_COLUMNS 5
|
| - |
|
10 |
#ifndef WIN32
|
| 10 |
#define MAX_ATTACHED 30 /* 31 including workspace.db */
|
11 |
#define MAX_ATTACHED 30 /* 31 including workspace.db */
|
| - |
|
12 |
#else
|
| - |
|
13 |
#define MAX_ATTACHED 10 /* set to 10 until I have recompiled it to 30 */
|
| - |
|
14 |
#endif
|
| 11 |
|
15 |
|
| 12 |
/* utilities for checking characteristics of arg */
|
16 |
/* utilities for checking characteristics of arg */
|
| 13 |
int _is_r_sym(char *sym);
|
17 |
int _is_r_sym(char *sym);
|
| 14 |
int _file_exists(char *filename);
|
18 |
int _file_exists(char *filename);
|
| 15 |
int _sdf_exists2(char *iname);
|
19 |
int _sdf_exists2(char *iname);
|
| 16 |
|
20 |
|
| 17 |
/* sdf utilities */
|
21 |
/* sdf utilities */
|
| 18 |
int USE_SDF(const char *iname); /* call this before doing anything on an SDF */
|
22 |
int USE_SDF(const char *iname, int exists); /* call this before doing anything on an SDF */
|
| 19 |
SEXP _create_sdf_sexp(const char *iname); /* create a SEXP for an SDF */
|
23 |
SEXP _create_sdf_sexp(const char *iname); /* create a SEXP for an SDF */
|
| 20 |
int _add_sdf1(char *filename, char *internal_name); /* add SDF to workspace */
|
24 |
int _add_sdf1(char *filename, char *internal_name); /* add SDF to workspace */
|
| 21 |
void _delete_sdf2(char *iname); /* remove SDF from workspace */
|
25 |
void _delete_sdf2(const char *iname); /* remove SDF from workspace */
|
| 22 |
int _get_factor_levels1(const char *iname, const char *varname, SEXP var);
|
26 |
int _get_factor_levels1(const char *iname, const char *varname, SEXP var);
|
| 23 |
int _get_row_count2(const char *table);
|
27 |
int _get_row_count2(const char *table);
|
| 24 |
SEXP _get_rownames(const char *sdf_iname);
|
28 |
SEXP _get_rownames(const char *sdf_iname);
|
| 25 |
char *_get_full_pathname2(char *relpath); /* get full path given relpath, used in workspace mgmt */
|
29 |
char *_get_full_pathname2(char *relpath); /* get full path given relpath, used in workspace mgmt */
|
| 26 |
|
30 |
|
| Line 53... |
Line 57... |
| 53 |
#define _sqlite_exec(sql) sqlite3_exec(g_workspace, sql, _empty_callback, NULL, NULL)
|
57 |
#define _sqlite_exec(sql) sqlite3_exec(g_workspace, sql, _empty_callback, NULL, NULL)
|
| 54 |
#ifndef SET_ROWNAMES
|
58 |
#ifndef SET_ROWNAMES
|
| 55 |
#define SET_ROWNAMES(x,n) setAttrib(x, R_RowNamesSymbol, n)
|
59 |
#define SET_ROWNAMES(x,n) setAttrib(x, R_RowNamesSymbol, n)
|
| 56 |
#endif
|
60 |
#endif
|
| 57 |
|
61 |
|
| - |
|
62 |
/* override R's, which does a GetRowNames which is different I believe */
|
| - |
|
63 |
#undef GET_ROWNAMES
|
| - |
|
64 |
#define GET_ROWNAMES(x) getAttrib(x, R_RowNamesSymbol)
|
| - |
|
65 |
|
| 58 |
/* R object accessors shortcuts */
|
66 |
/* R object accessors shortcuts */
|
| 59 |
#define CHAR_ELT(str, i) CHAR(STRING_ELT(str,i))
|
67 |
#define CHAR_ELT(str, i) CHAR(STRING_ELT(str,i))
|
| 60 |
|
68 |
|
| 61 |
/* SDF object accessors shortcuts */
|
69 |
/* SDF object accessors shortcuts */
|
| 62 |
#define SDF_INAME(sdf) CHAR(STRING_ELT(_getListElement(sdf, "iname"),0))
|
70 |
#define SDF_INAME(sdf) CHAR(STRING_ELT(_getListElement(sdf, "iname"),0))
|