int cSQLiteDatabase::getResultRow(void* DB, int NumCols, char** Values, char** ColNames){ cRow* Row = new cRow; Row->ColCount = NumCols; Row->Columns = new char*[NumCols]; Row->Values = new char*[NumCols]; for(int i=0; i < NumCols; i++){ Row->Columns[i] = strdup0(ColNames[i]); Row->Values[i] = strdup0(Values[i]); } cSQLiteDatabase* Database = (cSQLiteDatabase*)DB; Database->mRows->Add(Row); return 0; }
ast *nodo_nuevo_identificador(const char *s) { ast *a = (ast*)lat_asignar_memoria(sizeof(ast)); a->tipo = NODO_IDENTIFICADOR; nodo_valor *val = (nodo_valor*)lat_asignar_memoria(sizeof(nodo_valor)); val->t = VALOR_CADENA; val->v.s = strdup0(s); a->valor = val; a->valor->es_constante = false; return a; }
ast *nodo_nuevo_constante(char *s, int num_linea, int num_columna) { ast *a = (ast*)lat_asignar_memoria(sizeof(ast)); a->tipo = NODO_IDENTIFICADOR; nodo_valor *val = (nodo_valor*)lat_asignar_memoria(sizeof(nodo_valor)); val->t = VALOR_CADENA; val->v.s = strdup0(s); a->valor = val; a->valor->es_constante = true; a->valor->num_linea = num_linea; a->valor->num_columna = num_columna; return a; }
bool cRow::fetchColumn(char** Column, char** Value){ if (currentCol>=this->ColCount){ return false; } MESSAGE(VERBOSE_SQL_FETCHES,"Fetching column %s='%s' (%d/%d)", this->Columns[currentCol], this->Values[currentCol], currentCol+1, this->ColCount); *Column = strdup0(this->Columns[currentCol]); if (this->Values[currentCol]){ *Value = strcasecmp(this->Values[currentCol],"NULL")?strdup(this->Values[currentCol]):NULL; } else { *Value = NULL; } currentCol++; return true; }