This commit is contained in:
bnnm 2023-06-10 16:35:08 +02:00
parent 627e2310ad
commit 4e40b8d73c
2 changed files with 3 additions and 3 deletions

View File

@ -245,14 +245,14 @@ void utf_close(utf_context* utf) {
} }
int utf_get_column(utf_context* utf, const char* column) { int utf_get_column(utf_context* utf, const char* column_name) {
int i; int i;
/* find target column */ /* find target column */
for (i = 0; i < utf->columns; i++) { for (i = 0; i < utf->columns; i++) {
struct utf_column_t* col = &utf->schema[i]; struct utf_column_t* col = &utf->schema[i];
if (col->name == NULL || strcmp(col->name, column) != 0) if (col->name == NULL || strcmp(col->name, column_name) != 0)
continue; continue;
return i; return i;
} }

View File

@ -24,7 +24,7 @@ typedef struct utf_context utf_context;
utf_context* utf_open(STREAMFILE* sf, uint32_t table_offset, int* p_rows, const char** p_row_name); utf_context* utf_open(STREAMFILE* sf, uint32_t table_offset, int* p_rows, const char** p_row_name);
void utf_close(utf_context* utf); void utf_close(utf_context* utf);
int utf_get_column(utf_context* utf, const char* column); int utf_get_column(utf_context* utf, const char* column_name);
/* query calls (passing column index is faster, when you have to read lots of rows) */ /* query calls (passing column index is faster, when you have to read lots of rows) */
int utf_query_col_s8(utf_context* utf, int row, int column, int8_t* value); int utf_query_col_s8(utf_context* utf, int row, int column, int8_t* value);