@@ -110,23 +110,59 @@ void* sqlite3_get_table_idr(void* db,
112 tbl -> data_size = array_size;
112 tbl -> data_size = array_size;
119+ DBinfo* dbi =(DBinfo*) p;
120+ int rc, col, type, row_counter,i;
122+ const char* col_name;
114− int i, j, row, col;
124+ rc = sqlite3_step(dbi->ppStmt);
126+ if(rc != SQLITE_ROW && rc != SQLITE_DONE){
129+ col = sqlite3_column_count(dbi->ppStmt);
133+ while (rc == SQLITE_ROW) {
116− row = tbl->num_row;
135+ rc = sqlite3_step(dbi->ppStmt);
117− col = tbl->num_col;
136+ row_counter++;
119−// for( i=0; i< row; i++){
138+
120−// for(j=0;j<col; j++){
139+ dbi->row_count = row_counter;
121−// printf("%s\n", tbl->table_data[(i+1)*col +j]);
140+
122−//
141+ dbi->col_count = col;
126− return tbl;
144+ return type;
148+int sqlite3_get_num_row_v2(void* p){
150+ DBinfo* dbi =(DBinfo*) p;
151+ int row_number =dbi->row_count;
157+int sqlite3_get_num_col_v2(void* p){
159+ DBinfo* dbi =(DBinfo*) p;
160+ int col_number =dbi-> col_count;
130int sqlite3_get_num_row(void* p){
166int sqlite3_get_num_row(void* p){
132 Table* tbl =(Table*) p;
168 Table* tbl =(Table*) p;
@@ -142,6 +178,38 @@ int sqlite3_get_num_col(void* p){
142 int col_number =tbl-> num_col;
178 int col_number =tbl-> num_col;
143 return col_number;
179 return col_number;
182+int sqlite3_get_data_type_v2(void* p, int nRow, int nCol){
184+ DBinfo* dbi =(DBinfo*) p;
185+ int rc, type, row_counter;
186+ const char* char_int;
188+ rc = sqlite3_reset(dbi->ppStmt);
189+ rc = sqlite3_step(dbi->ppStmt);
192+ while (rc == SQLITE_ROW && row_counter < nRow) {
194+ rc = sqlite3_step(dbi->ppStmt);
197+ type =sqlite3_column_type(dbi->ppStmt, nCol);
203+int sqlite3_get_val_int_v2(void* p, int nCol){
206+ DBinfo* dbi =(DBinfo*) p;
209+ val =sqlite3_column_int(dbi->ppStmt, nCol);
147int sqlite3_get_data_type(void* p,const char* tbl_name, int nRow, int nCol){
215int sqlite3_get_data_type(void* p,const char* tbl_name, int nRow, int nCol){
@@ -171,7 +239,6 @@ int sqlite3_get_data_type(void* p,const char* tbl_name, int nRow, int nCol){
173 val =sqlite3_column_type(stmt, nCol);
241 val =sqlite3_column_type(stmt, nCol);
174− //printf("Type : %d\n", val );
176 rc =sqlite3_finalize(stmt);
243 rc =sqlite3_finalize(stmt);
177 if( rc != SQLITE_OK){
244 if( rc != SQLITE_OK){
@@ -219,6 +286,22 @@ int sqlite3_get_val_int(void* p,const char* tbl_name, int nRow, int nCol){
289+const unsigned char* sqlite3_get_val_text_v2(void* p,int nCol){
292+ DBinfo* dbi =(DBinfo*) p;
293+ int rc,i, val, counter;
294+ const unsigned char* text_val;
296+ array =(unsigned char *) GC_malloc(1000*sizeof(char));
298+ text_val =sqlite3_column_text(dbi->ppStmt, nCol);
299+ memcpy(array, text_val, sizeof(text_val));
223const unsigned char* sqlite3_get_val_text(void* p,const char* tbl_name,int nRow, int nCol){
306const unsigned char* sqlite3_get_val_text(void* p,const char* tbl_name,int nRow, int nCol){
@@ -291,7 +374,6 @@ float sqlite3_get_float(void* p,const char* tbl_name, int nRow, int nCol){
292 double_val =sqlite3_column_double(stmt, nCol);
375 double_val =sqlite3_column_double(stmt, nCol);
293 float float_val =(float)double_val;
376 float float_val =(float)double_val;
294− //printf("float_val %f\n", float_val);
295 rc =sqlite3_finalize(stmt);
377 rc =sqlite3_finalize(stmt);
296 if( rc != SQLITE_OK){
378 if( rc != SQLITE_OK){
297 printf("Couldn't finalize.\n");
379 printf("Couldn't finalize.\n");
@@ -300,6 +382,17 @@ float sqlite3_get_float(void* p,const char* tbl_name, int nRow, int nCol){
385+float sqlite3_get_float_v2(void* p, int nCol){
387+ DBinfo* dbi =(DBinfo*) p;
390+ double_val =sqlite3_column_double(dbi->ppStmt, nCol);
391+ float float_val =(float)double_val;
304void sqlite3_free_table_idr(void* db){
397void sqlite3_free_table_idr(void* db){
305 Table* tbl =(Table*) db;
398 Table* tbl =(Table*) db;