summaryrefslogtreecommitdiffstats
path: root/smtk-import/smartrak.c
diff options
context:
space:
mode:
authorGravatar Salvador Cuñat <salvador.cunat@gmail.com>2018-09-05 22:37:18 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-06 12:23:51 -0700
commit4c9aeca0df02f6b94f64c6034aed729da8b2b2ba (patch)
tree7f013b098b34882b31bb013f3c0bd7c97baa0abe /smtk-import/smartrak.c
parent650b198715ad9a7d8a90c7f1604de79253456fa4 (diff)
downloadsubsurface-4c9aeca0df02f6b94f64c6034aed729da8b2b2ba.tar.gz
[smtk-import] Remove now unused smtk-value-by-idx()
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Diffstat (limited to 'smtk-import/smartrak.c')
-rw-r--r--smtk-import/smartrak.c41
1 files changed, 0 insertions, 41 deletions
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
@@ -205,46 +205,6 @@ static MdbTableDef *smtk_open_table(MdbHandle *mdb, char *tablename, MdbColumn
}
/*
- * 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.
* If the original string is NULL, then just returns the third.
@@ -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 */