rem: stbl.s = CON_TABLE(_h);
add: stbl.s = (char*)CON_TABLE(_h);
context: int dbt_insert(db_con_t* _h, db_key_t* _k, db_val_t* _v, int _n){	tbl_cache_p _tbc = NULL;	dbt_table_p _dtp = NULL;	dbt_row_p _drp = NULL;		str stbl;	int *lkey=NULL, i, j;		if (!_h || !CON_TABLE(_h))	{#ifdef DBT_EXTRA_DEBUG		LOG(L_ERR, "DBT:dbt_insert: Invalid parameter value\n");#endif		return -1;	}	if(!_k || !_v || _n<=0)	{#ifdef DBT_EXTRA_DEBUG		DBG("DBT:dbt_insert: no key-value to insert\n");#endif		return -1;	}		stbl.s = CON_TABLE(_h);	stbl.len = strlen(CON_TABLE(_h));	_tbc = dbt_db_get_table(DBT_CON_CONNECTION(_h), &stbl);	if(!_tbc)	{		DBG("DBT:db_insert: table does not exist!\n");		return -1;	}	lock_get(&_tbc->sem);		_dtp = _tbc->dtp;	if(!_dtp)	{		DBG("DBT:db_insert: table does not exist!!\n");		goto error;	}		if(_dtp->nrcols<_n)	{		DBG("DBT:db_insert: more values than columns!!\n");		goto error;	}		if(_k)	{		lkey = dbt_get_refs(_dtp, _k, _n);		if(!lkey)			goto error;	}	_drp = dbt_row_new(_dtp->nrcols);	if(!_drp)	{		DBG("DBT:db_insert: no memory for a new row!!\n");		goto error;	}		for(i=0; i<_n; i++)	{		j = (lkey)?lkey[i]:i;		if(dbt_is_neq_type(_dtp->colv[j]->type, _v[i].type))		{			DBG("DBT:db_insert: incompatible types v[%d] - c[%d]!\n", i, j);			goto clean;		}		if(dbt_row_set_val(_drp, &(_v[i]), _v[i].type, j))		{			DBG("DBT:db_insert: cannot set v[%d] in c[%d]!\n", i, j);			goto clean;		}			}	if(dbt_table_add_row(_dtp, _drp))	{		DBG("DBT:db_insert: cannot insert the new row!!\n");		goto clean;	}#ifdef DBT_EXTRA_DEBUG	dbt_print_table(_dtp, NULL);#endif		lock_release(&_tbc->sem);	if(lkey)		pkg_free(lkey);	DBG("DBT:db_insert: done!\n");    return 0;	error:	lock_release(&_tbc->sem);	if(lkey)		pkg_free(lkey);	DBG("DBT:db_insert: error inserting row in table!\n");    return -1;	clean:	lock_release(&_tbc->sem);	if(lkey)		pkg_free(lkey);		if(_drp) // free row		dbt_row_free(_dtp, _drp);		DBG("DBT:db_insert: make clean!\n");    return -1;}