From 4c9aeca0df02f6b94f64c6034aed729da8b2b2ba Mon Sep 17 00:00:00 2001 From: Salvador Cuñat Date: Wed, 5 Sep 2018 22:37:18 +0200 Subject: [smtk-import] Remove now unused smtk-value-by-idx() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Salvador Cuñat --- smtk-import/smartrak.c | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'smtk-import') diff --git a/smtk-import/smartrak.c b/smtk-import/smartrak.c index 3dfb3a7cd..ef0a14ee2 100644 --- a/smtk-import/smartrak.c +++ b/smtk-import/smartrak.c @@ -204,46 +204,6 @@ static MdbTableDef *smtk_open_table(MdbHandle *mdb, char *tablename, MdbColumn return table; } -/* - * Utility function which returns the value from a given column in a given table, - * whose row equals the given idx string. - * Idx should be a numeric value, but all values obtained from mdbtools are strings, - * so let's compare strings instead of numbers to avoid unnecessary transforms. - */ -static char *smtk_value_by_idx(MdbHandle *mdb, char *tablename, int colnum, char *idx) -{ - MdbCatalogEntry *entry; - MdbTableDef *table; - MdbColumn *idxcol, *valuecol; - char *bounder[MDB_MAX_COLS], *str = NULL; - int i = 0; - - entry = mdb_get_catalogentry_by_name(mdb, tablename); - table = mdb_read_table(entry); - if (!table) { - report_error("[Error][smartrak_import]\t%s table doesn't exist\n", tablename); - return str; - } - mdb_read_columns(table); - idxcol = g_ptr_array_index(table->columns, 0); - valuecol = g_ptr_array_index(table->columns, colnum); - for (i = 0; i < table->num_cols; i++) { - bounder[i] = (char *) g_malloc(MDB_BIND_SIZE); - mdb_bind_column(table, i+1, bounder[i], NULL); - } - mdb_rewind_table(table); - for (i = 0; i < table->num_rows; i++) { - mdb_fetch_row(table); - if (!strcmp(idxcol->bind_ptr, idx)) { - str = copy_string(valuecol->bind_ptr); - break; - } - } - smtk_free(bounder, table->num_cols); - mdb_free_tabledef(table); - return str; -} - /* * Utility function which joins three strings, being the second a separator string, * usually a "\n". The third is a format string with an argument list. @@ -568,7 +528,6 @@ static void smtk_head_insert(struct types_list **head, int index, char *txt) item->text = txt; *head = item; item = NULL; - free(item); } /* Clean types_list lists */ -- cgit v1.2.3-70-g09d2