GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
DBMI Library (base) - index management. More...
Go to the source code of this file.
Functions | |
void | db_init_index (dbIndex *index) |
Initialize dbIndex. More... | |
void | db_free_index (dbIndex *index) |
Free allocated dbIndex. More... | |
int | db_alloc_index_columns (dbIndex *index, int ncols) |
Allocate index columns. More... | |
dbIndex * | db_alloc_index_array (int count) |
Allocate index array. More... | |
void | db_free_index_array (dbIndex *list, int count) |
Free index array. More... | |
int | db_set_index_name (dbIndex *index, const char *name) |
Set index name. More... | |
const char * | db_get_index_name (dbIndex *index) |
Get index name. More... | |
int | db_set_index_table_name (dbIndex *index, const char *name) |
Set table name. More... | |
const char * | db_get_index_table_name (dbIndex *index) |
Get table name. More... | |
int | db_get_index_number_of_columns (dbIndex *index) |
Get number of columns. More... | |
int | db_set_index_column_name (dbIndex *index, int column_num, const char *name) |
Set column name. More... | |
const char * | db_get_index_column_name (dbIndex *index, int column_num) |
Get column number. More... | |
int | db_set_index_type_unique (dbIndex *index) |
Set index type to unique. More... | |
int | db_set_index_type_non_unique (dbIndex *index) |
Set index type to non-unique. More... | |
int | db_test_index_type_unique (dbIndex *index) |
Test if type is unique. More... | |
void | db_print_index (FILE *fd, dbIndex *index) |
Report index. More... | |
DBMI Library (base) - index management.
(C) 1999-2009, 2011 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file db/dbmi_base/index.c.
dbIndex* db_alloc_index_array | ( | int | count | ) |
Allocate index array.
count | number of items |
Definition at line 73 of file db/dbmi_base/index.c.
References count, db_calloc(), db_init_index(), and list.
Referenced by db__recv_index_array().
int db_alloc_index_columns | ( | dbIndex * | index, |
int | ncols | ||
) |
Allocate index columns.
index | pointer to dbIndex |
ncols | number of columns to be allocated |
Definition at line 56 of file db/dbmi_base/index.c.
Referenced by db_create_index2().
void db_free_index | ( | dbIndex * | index | ) |
Free allocated dbIndex.
index | pointer to dbIndex to be freed |
Definition at line 39 of file db/dbmi_base/index.c.
References _db_index::columnNames, db_free_string(), db_free_string_array(), db_init_index(), _db_index::indexName, _db_index::numColumns, and _db_index::tableName.
Referenced by db_create_index2(), db_d_create_index(), and db_free_index_array().
void db_free_index_array | ( | dbIndex * | list, |
int | count | ||
) |
Free index array.
list | dbIndex array |
count | number of items in the array |
Definition at line 92 of file db/dbmi_base/index.c.
References count, db_free(), and db_free_index().
Referenced by db_d_list_indexes().
const char* db_get_index_column_name | ( | dbIndex * | index, |
int | column_num | ||
) |
Get column number.
index | pointer to dbIndex |
column_num | column number |
Definition at line 194 of file db/dbmi_base/index.c.
References _, _db_index::columnNames, db_error(), db_get_string(), NULL, and _db_index::numColumns.
Referenced by db_print_index().
const char* db_get_index_name | ( | dbIndex * | index | ) |
Get index name.
index | pointer to dbIndex |
Definition at line 124 of file db/dbmi_base/index.c.
References db_get_string(), and _db_index::indexName.
Referenced by db_print_index().
int db_get_index_number_of_columns | ( | dbIndex * | index | ) |
Get number of columns.
index | pointer to dbIndex |
Definition at line 162 of file db/dbmi_base/index.c.
References _db_index::numColumns.
Referenced by db_print_index().
const char* db_get_index_table_name | ( | dbIndex * | index | ) |
Get table name.
index | pointer to dbIndex |
Definition at line 150 of file db/dbmi_base/index.c.
References db_get_string(), and _db_index::tableName.
Referenced by db_print_index().
void db_init_index | ( | dbIndex * | index | ) |
Initialize dbIndex.
index | pointer to dbIndex to be initialized |
Definition at line 25 of file db/dbmi_base/index.c.
References _db_index::columnNames, db_init_string(), _db_index::indexName, NULL, _db_index::numColumns, _db_index::tableName, and _db_index::unique.
Referenced by db_alloc_index_array(), db_create_index2(), db_d_create_index(), and db_free_index().
void db_print_index | ( | FILE * | fd, |
dbIndex * | index | ||
) |
Report index.
fd | file where to print index info |
index | pointer to dbIndex |
Definition at line 254 of file db/dbmi_base/index.c.
References db_get_index_column_name(), db_get_index_name(), db_get_index_number_of_columns(), db_get_index_table_name(), and db_test_index_type_unique().
int db_set_index_column_name | ( | dbIndex * | index, |
int | column_num, | ||
const char * | name | ||
) |
Set column name.
index | pointer to dbIndex |
column_num | column number |
name | name to be set |
Definition at line 177 of file db/dbmi_base/index.c.
References _, _db_index::columnNames, db_error(), db_get_error_code(), db_set_string(), name, and _db_index::numColumns.
Referenced by db_create_index2().
int db_set_index_name | ( | dbIndex * | index, |
const char * | name | ||
) |
Set index name.
index | pointer to dbIndex |
name | name to be set |
Definition at line 112 of file db/dbmi_base/index.c.
References db_set_string(), _db_index::indexName, and name.
Referenced by db_create_index2().
int db_set_index_table_name | ( | dbIndex * | index, |
const char * | name | ||
) |
Set table name.
index | pointer to dbIndex |
name | name to be set |
Definition at line 138 of file db/dbmi_base/index.c.
References db_set_string(), name, and _db_index::tableName.
Referenced by db_create_index2().
int db_set_index_type_non_unique | ( | dbIndex * | index | ) |
Set index type to non-unique.
index | pointer to dbIndex |
Definition at line 228 of file db/dbmi_base/index.c.
References _db_index::unique.
int db_set_index_type_unique | ( | dbIndex * | index | ) |
Set index type to unique.
index | pointer to dbIndex |
Definition at line 212 of file db/dbmi_base/index.c.
References _db_index::unique.
Referenced by db_create_index2().
int db_test_index_type_unique | ( | dbIndex * | index | ) |
Test if type is unique.
index | pointer to dbIndex |
Definition at line 243 of file db/dbmi_base/index.c.
References _db_index::unique.
Referenced by db_print_index().